The Audi A3 car rammed into people on the seaside promenade of the tourist city 120 kilometres south of Barcelona, where a van had earlier sped into a street packed full of tourists, killing 13 people and injuring around 100 others.
One of the injured in Cambrils is in critical condition, emergency services said.
The five attackers in the car were shot dead, police added. Some of them wore what looked like explosive belts.
"The alleged terrorists were in an Audi A3 and apparently knocked down several people before coming across a police patrol and a shoot-out ensued," said a spokesman for the regional government of Catalonia, where Cambrils is located in Spain's northeast.
Markel Artabe, a 20-year-old restaurant worker, said he was on the seaside promenade when he heard what he initially thought were fireworks, but soon realised were gunshots.
He said he saw someone lying on the ground "with a gunshot in the head". The victim's friends were crying out "help", he added.
Joan Marc Serra Salinas, a 21-year-old waiter, said he heard many gunshots.
Police said they were "working on the hypothesis that the terrorists shot dead in Cambrils could be linked to what happened in Barcelona".
The driver of the van in the Barcelona attack managed to escape and is still on the run.
Two other suspects, a Spaniard and a Moroccan, have been detained.
In a further twist, the Spaniard was arrested in Alcanar, about 200 kilometres south of Barcelona and the scene of an explosion in a house late Wednesday that left one person dead and seven wounded and is believed to be linked to Thursday's assault.
"We suspect that they (the occupants) were preparing an explosive device," Josep Lluis Trapero of the regional Catalonia police told reporters.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.