Spain's Interior Minister Juan Ignacio Zoido, visiting his Moroccan counterpart Tuesday, said Rabat had arrested two men linked to deadly twin attacks in Catalonia.
"Thanks to permanent contact and collaboration between the two countries, Moroccan security services have carried out two arrests here in Morocco linked to the attacks in Barcelona and Cambrils," he said.
He declined to give further details because the men were still under investigation.
Zoido was in Rabat to meet Moroccan Interior Minister Abdelouafi Laftit for talks on the investigation into the attacks on August 17 and 18 which left 16 people dead.
The main suspects in the attacks, claimed by the Islamic State group, were of Moroccan origin, but most had lived in Spain for several years.
The two ministers said Morocco was working closely with Spanish security forces.
Laftit warned of the potential influence of "uncontrolled mosques" and "extremist imams" on members of Europe's Moroccan diaspora.
"The children of second and third generation Moroccan immigrants who were born in European countries need particular attention (if they are to) escape the clutches of terrorism," he said.