The nine ISIS thugs who plotted slaughter on the streets of Barcelona meticulously orchestrated their sinister plot for maximum carnage.

Among the dead was one Canadian. Four others were injured.

“It was with great sadness that I learned today that one Canadian was killed and four others injured during yesterday’s cowardly terrorist attack in Barcelona,” Prime Minister Justin Trudeau said in a statement Friday.

“Sophie and I offer our condolences to the families and friends in mourning, and hope for a speedy recovery for the injured Canadians,” he added.

“We join Spain and countries around the world in grieving the senseless loss of so many innocent people,” Trudeau said. “We must stand firm against the spread of hate and intolerance in all its forms. These violent acts that seek to divide us will only strengthen our resolve.”

The nine members of the plot were committed jihadists who had promised murder.

In one online forum, one user asked Moussa Oukibir, one of the attackers: “On your first day as absolute king of the world, what would you do?”

He replied: “Kill the infidels and leave only Muslims who follow the religion.”

On Thursday he kept his word.

Oukibir and his confederates combined vans and bombs hoping to kill as many tourists as possible in Barcelona.

So far, 14 people from around the world were killed. The suspected youngest victim — a British boy — is just 7. Nine of the dead have been identified.

Now, as Europe is left reeling from yet another terrorist attack, intelligence agents are scouring the continent for remaining members of the Moroccan terror cell.

The latest:

Flawed bomb construction prevented the massacre from being worse.

Armed with an axe, knives and false explosives belts, attackers drove a second vehicle to the boardwalk in Cambrils early Friday, killing a woman.

Five of the ISIS thugs, including Oukabir, were shot to death by cops.

It’s believed at least one terrorist is still on the loose.

Cops are taking a closer look at a house explosion in Alcanar that killed one person.

The attacks have heightened fears across Europe that ISIS thugs fresh from watching their beloved caliphate obliterated by Allied forces will enact their vengeance.

“This shows there is no correlation between what is happening over there with Daesh and the operational capacity of the group,” said Jean-Charles Brisard, a French security analyst, using another name for the group.

Authorities said the two attacks were related and the work of a large terrorist cell that had been plotting for a long time from the house in Alcanar, 200 km down the coast from Barcelona.

Police said they arrested two people Friday in addition to the two arrests a day earlier. In custody are three Moroccans and one Spaniard, none with terrorism-related records.

“We are not talking about a group of one or two people, but rather a numerous group,” regional Interior Ministry Chief Joaquim Forn told Onda Cero radio.

Yet the possibility that members of the Spanish death cell could still be at large was chilling.

Those who have survived prior attacks nearly always ended their lives but not before satisfying their bloodlust and dying in a hail of police bullets.

“There is the danger they will not let themselves get caught and will do something dramatic,” said Alain Chouet, a former French intelligence official.

Amid heavy security, Barcelona tried to move forward Friday, with the Las Ramblas promenade quietly reopening to the public with Spain’s King Felipe VI and Prime Minister Mariano Rajoy joining thousands in a minute of silence in the city’s main square.

“I am not afraid! I am not afraid!” the crowd chanted in Catalan and Spanish.

— The Associated Press