Spanish police say they have shot dead five suspected terrorists attempting to carry out a second attack in a seaside resort an hour away from Barcelona, where at least 13 people were killed and more than 100 injured by a van ploughing into crowds on Barcelona’s historic Las Ramblas.

Detectives say they believe the Barcelona attack and the later incident in Cambrils are linked. Six members of the public and a police officer were injured in the attack when the suspects ran them over in a car, before police shot them dead and carried out controlled explosions. Detectives are connecting the attacks to a house explosion down the coast on Wednesday, where people are thought to have been preparing bombs.

Police continue working to piece together the events that led to the Barcelona tragedy, with Prime Minister Mariano Rajoy saying it was a "jihadist attack". A manhunt goes on for those involved after the driver fled the scene on foot.

Two suspects were said to be in custody in connection to the attack last night, a Spanish national from the enclave of Melilla which borders Morocco, and a Moroccan. Neither were believed to be the driver of the van. Another man was shot dead by police having run over two police officers at a checkpoint around six miles away in the wake of the van attack, although authorities later revealed that the incidents were not connected.

And a third man was arrested on Friday morning in the Catalan town of Ripoll in relation to the Barcelona attack, according to Catalan radio.

Isis was quick to claim responsibility, which follows a number of vehicle-based atrocities over the last year. The jihadi group has repeatedly called for such attacks on European targets, although it is currently unclear whether those behind the attack had any direct connection to Isis.

The head of Catalonia’s interior department, Joaquin Form, said that the incident was “clearly a terror attack intended to kill as many people as possible” as he announced three days of mourning. Belgium was first to say that one of its nationals was one among the dead.

The van was said to have been driven down the pedestrian walkway from the top of Las Ramblas to near the city’s opera house. Witnesses on the scene told of hearing a “loud bang” followed by hordes of people screaming as the attack took place.

Emma Waterhouse, 24, who was with her family at the time of the attack, told The Independent: “We heard screeching noises and then screaming. Everyone started running in different directions and me, my mum and sister jumped on to the pavement behind a pillar as the van sped down the street.

“My dad ran across the road to join us as he had gone in the other direction and said there were lots of bodies. He saw people being hit.

“The van ploughed into the seating outside restaurants and people were struggling to run away because of the chairs,” she added. “Everyone was running to the sides of the street and then either into shops or down the side streets... We are in shock. I honestly thought the van was going to hit us.”

13 dead and more than 100 injured as van driver brings terror to Barcelona

Mr Form warned that the death toll was likely to increase thanks to the nature of some of the injuries, although the humanity of people in the city was also on display with long queues forming to give blood to help the victims.

Ethan Spibey, 25, told The Independent there was a “stampede” as tourists and locals sprinted away from the scene of the attack.

He said: “I was with my boyfriend just about to cross Las Ramblas and all of a sudden there was an immediate stampede and police shouting at people to run. There was a stampede in the streets alongside Las Ramblas as everyone tried to run away. People were running into shops and taking refuge in cafes. There was a lot of screaming.”

“People just turned and sprinted in the opposite direction as the police were screaming at people to run away. They were telling people to get away as soon as possible. It was very scary.”

Barcelona Attack Show all 30 1 /30 Barcelona Attack Barcelona Attack Police officers patrol on Las Ramblas following yesterday's terrorist attack, on August 18, 2017 in Barcelona, Spain. Thirteen people were killed and dozens injured when a van hit crowds in the Las Ramblas area of Barcelona on Thursday. Spanish police have also killed five suspected terrorists in the town of Cambrils to stop a second terrorist attack Getty Images Barcelona Attack Tourists and locals walk along Las Ramblas following yesterday's terrorist attack, on August 18, 2017 in Barcelona, Spain. Thirteen people were killed and dozens injured when a van hit crowds in the Las Ramblas area of Barcelona on Thursday. Spanish police have also killed five suspected terrorists in the town of Cambrils to stop a second terrorist attack. Getty Images Barcelona Attack Police officers patrol on Las Ramblas following yesterday's terrorist attack, on August 18, 2017 in Barcelona, Spain. Thirteen people were killed and dozens injured when a van hit crowds in the Las Ramblas area of Barcelona on Thursday. Spanish police have also killed five suspected terrorists in the town of Cambrils to stop a second terrorist attack. Getty Images Barcelona Attack People leave a fastfood with hands up as asked by policemen after a van ploughed into the crowd, killing two persons and injuring several others on the Rambla in Barcelona on August 17, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least two people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack" and a police source said one suspect had left the scene and was "holed up in a bar". The police source said they were hunting for a total of two suspects AFP/Getty Barcelona Attack Police officers tell members of the public to leave the scene in a street in Barcelona, Spain, Thursday, Aug. 17, 2017. Police in the northern Spanish city of Barcelona say a white van has jumped the sidewalk in the city's historic Las Ramblas district, injuring several people. AP Barcelona Attack Injured people react after a van crashed into pedestrians in Las Ramblas, downtown Barcelona, Spain, 17 August 2017. According to initial reports a van crashed into a crowd in Barcelona's famous Placa Catalunya square at Las Ramblas area injuring several. Local media report the van driver ran away, metro and train stations were closed. The number of people injured and the reasons behind the incident are not yet known. Official sources have not confirmed that the incident is a terrorist attack. EPA Barcelona Attack People flee the scene in Barcelona, Spain, Thursday, Aug. 17, 2017 after a white van jumped the sidewalk in the historic Las Ramblas district, crashing into a summer crowd of residents and tourists and injuring several people, police said. (AP Photo/Giannis Papanikos) AP Barcelona Attack People are pictured inside Systemaction, a locked down store after a van crashed into crowds on Las Ramblas in Barcelona, Spain, August 17, 2017. Courtesy Abbie Yermus/Handout via REUTERS ATTENTION EDITORS - THIS IMAGE WAS PROVIDED BY A THIRD PARTY. REUTERS Barcelona Attack People take shelter inside a shop in Barcelona, Spain, Thursday, Aug. 17, 2017. A white van jumped up onto a sidewalk and sped down a pedestrian zone Thursday in Barcelona's historic Las Ramblas district, swerving from side to side as it plowed into tourists and residents. Police said 13 people were killed and more than 50 wounded in what they called a terror attack. (AP Photo/Manu Fernandez) AP Barcelona Attack People move from the scene after a van crashed into pedestrians near the Las Ramblas avenue Reuters Barcelona Attack A policeman stands next to an ambulance after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona AFP/Getty Images Barcelona Attack People are evacuated from a street after a van crashed into pedestrians near the Las Ramblas avenue in central Barcelona, Spain, August 17, 2017. REUTERS/Stringer NO RESALES. NO ARCHIVE. Reuters Barcelona Attack Firefighters stands outside an evacuated mall after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona AFP/Getty Images Barcelona Attack Policemen stand next to vehicles in a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona AFP/Getty Images Barcelona Attack Plain-clothes policemen phone as they walk past police cars in a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona AFP/Getty Images Barcelona Attack A policemen and a medical staff member stand past police cars and an ambulance in a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona AFP/Getty Images Barcelona Attack A person is stretched out of a mall by medical staff members in a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona on August 17, 2017. Police in Barcelona said they were dealing with a "terrorist attack" after a vehicle ploughed into a crowd of pedestrians on the city's famous Las Ramblas boulevard on August 17, 2017. Police were clearing the area after the incident, which has left a number of people injured. AFP/Getty Images Barcelona Attack Children, some in tears, are escorted down a road in Barcelona, Spain, Thursday, Aug. 17, 2017. Police in Barcelona say a white van has mounted a sidewalk, struck several people in the city's Las Ramblas district. AP Barcelona Attack Mossos d'Esquadra Police officers and emergency service workers move an injured man, after a van crashes into pedestrians in Las Ramblas, downtown Barcelona, Spain, 17 August 2017. According to initial reports a van crashed into a crowd in Barcelona's famous Placa Catalunya square at Las Ramblas area injuring several. Local media report the van driver ran away, metro and train stations were closed. The number of people injured and the reasons behind the incident are not yet known. Official sources have not confirmed that the incident is a terrorist attack. EPA Barcelona Attack Mossos d'Esquadra Police officers attend injured people after a van crashed into pedestrians in Las Ramblas, downtown Barcelona, Spain, 17 August 2017. According to initial reports a van crashed into a crowd in Barcelona's famous Placa Catalunya square at Las Ramblas area injuring several. Local media report the van driver ran away, metro and train stations were closed. The number of people injured and the reasons behind the incident are not yet known. Official sources have not confirmed that the incident is a terrorist attack. EPA Barcelona Attack Injured people react after a van crashed into pedestrians in Las Ramblas, downtown Barcelona, Spain, 17 August 2017. According to initial reports a van crashed into a crowd in Barcelona's famous Placa Catalunya square at Las Ramblas area injuring several. Local media report the van driver ran away, metro and train stations were closed. The number of people injured and the reasons behind the incident are not yet known. Official sources have not confirmed that the incident is a terrorist attack. EPA Barcelona Attack A police officer cordon off a street in Barcelona, Spain, Thursday, Aug. 17, 2017. Police in the northern Spanish city of Barcelona say a white van has jumped the sidewalk in the city's historic Las Ramblas district, injuring several people. AP Barcelona Attack TOPSHOT - Policemen check the area after towing away the van which ploughed into the crowd, killing at least 13 people and injuring around 100 others on the Rambla in Barcelona, on August 18, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". The driver of a van that mowed into a packed street in Barcelona is still on the run, Spanish police said. / AFP PHOTO / Josep LAGOJOSEP LAGO/AFP/Getty Images AFP/Getty Images Barcelona Attack TOPSHOT - Armed policemen stand in a cordoned off area after a van ploughed into the crowd, injuring several persons on the Rambla in Barcelona on August 17, 2017. Police in Barcelona said they were dealing with a "terrorist attack" after a vehicle ploughed into a crowd of pedestrians on the city's famous Las Ramblas boulevard on August 17, 2017. Police were clearing the area after the incident, which has left a number of people injured. / AFP PHOTO / Josep LAGOJOSEP LAGO/AFP/Getty Images AFP/Getty Barcelona Attack A man displays flowers at the Canaletas fountain on the Rambla boulevard on August 18, 2017, a day after a van ploughed into the crowd, killing 13 persons and injuring over 100 on the Rambla in Barcelona. Drivers have ploughed on August 17, 2017 into pedestrians in two quick-succession, separate attacks in Barcelona and another popular Spanish seaside city, leaving 13 people dead and injuring more than 100 others. In the first incident, which was claimed by the Islamic State group, a white van sped into a street packed full of tourists in central Barcelona on Thursday afternoon, knocking people out of the way and killing 13 in a scene of chaos and horror. Some eight hours later in Cambrils, a city 120 kilometres south of Barcelona, an Audi A3 car rammed into pedestrians, injuring six civilians -- one of them critical -- and a police officer, authorities said. / AFP PHOTO / Josep LAGOJOSEP LAGO/AFP/Getty Images AFP/Getty Images Barcelona Attack TOPSHOT - The van who ploughed into the crowd, killing at least 13 people and injuring around 100 others is towed away from the Rambla in Barcelona on August 18, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". The driver of a van that mowed into a packed street in Barcelona is still on the run, Spanish police said. / AFP PHOTO / Josep LAGOJOSEP LAGO/AFP/Getty Images AFP/Getty Barcelona Attack TOPSHOT - Forensic policemen arrive in the cordoned off area after a van ploughed into the crowd, killing 13 persons and injuring over 80 on the Rambla in Barcelona on August 17, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". / AFP PHOTO / Josep LAGOJOSEP LAGO/AFP/Getty Images AFP/Getty Images Barcelona Attack TOPSHOT - A person is helped by Spanish policemen and two men after a van ploughed into the crowd, killing at least 13 people and injuring around 100 others on the Rambla in Barcelona on August 17, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". The driver of a van that mowed into a packed street in Barcelona is still on the run, Spanish police said. / AFP PHOTO / Nicolas CARVALHO OCHOANICOLAS CARVALHO OCHOA/AFP/Getty Images AFP/Getty Images Barcelona Attack TOPSHOT - Policemen accompany clients of a store outside a cordoned off off area after a van ploughed into the crowd, killing 13 persons and injuring over 80 on the Rambla in Barcelona on August 17, 2017. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". / AFP PHOTO / LLUIS GENELLUIS GENE/AFP/Getty Images AFP/Getty Images Barcelona Attack TOPSHOT - Forensic policemen arrive in the cordoned off area after a van ploughed into the crowd, killing at least 13 people and injuring around 100 others on the Rambla in Barcelona. A driver deliberately rammed a van into a crowd on Barcelona's most popular street on August 17, 2017 killing at least 13 people before fleeing to a nearby bar, police said. Officers in Spain's second-largest city said the ramming on Las Ramblas was a "terrorist attack". The driver of a van that mowed into a packed street in Barcelona is still on the run, Spanish police said. / AFP PHOTO / PAU BARRENAPAU BARRENA/AFP/Getty Images AFP/Getty Images

By Thursday evening, the usual bustle of the city centre streets was gone, as tourists and locals stayed away from Plaza Catalunya and Las Ramblas. Police blocked off all entrances to the area where the attack took place, causing the odd moment of tension between officers and people trying to get through.

“For God’s sake, there has been a terrorist attack here,” shouted one at a citizen who was refusing to turn back, but mostly the mood was quiet, as people tried to take stock of what had happened.

Mr Spibey said he had taken refuge in a church and was locked in as police dealt with the scene. “My boyfriend and I have come into a church with about 80 people, tourists and Spaniards,” he said. Shoppers in the Corte Ingles department store were forced to stay in the shop for two hours after the attack while the shutters came down in many other outlets surrounding La Rambla, the main thoroughfare in the district.

Robert Yelito, a US citizen but resident in Madrid, was trapped in one with his husband, where they were forced to stay for an hour until the police let them out.

It is not clear how many were involved directly in the attack, although the two arrests came in two separate towns in the region of Catalonia, Ripoli and Alcanar – the latter was the location for the explosion in a house on Wednesday that police said appeared to be linked to the van attack. That explosion killed one person and injured another.

Police also released the image of a man named as Driss Oukabir, whose documents were allegedly used to rent the van involved in the attack.

But local reports later suggested that a man had walked into a a police station in Ripoli, a small town around 90 miles north of Barcelona, identifying himself as Mr Oukabir.

He was said to have told officers that that his 18-year-old brother Moussa, who lives in Barcelona, had stolen his documents. The elder brother is thought to have been arrested in connection with the atrocity.

Following the van attack leaders from Spain lined up to condemn it – with the tragedy striking at the height of tourist season. It was the deadliest attack in Spain since March 2004, when Islamist militants placed bombs on commuter trains in Madrid, killing 191 people and wounding more than 1,800.

World reacts: Barcelona terror attack

Taking to Twitter, the Spanish royal household said: “They are murderers, nothing more than criminals who are not going to terrorise us. All of Spain is Barcelona. Las Ramblas will go back to being everyone’s”.

Leaders from around the world also sent messages of support. Prime Minister Theresa May said that the “the UK stands with Spain against terror”, while French President Emmanuel Macron tweeted: “All my thoughts and solidarity from France for the victims of the tragic attack in Barcelona. We will remain united and determined.”

Donald Trump said that the US will do “whatever is necessary to help,” tweeting: “Be tough and strong, we love you!”