Morocco has arrested 152 people, who will now face trial on accusations they used social media to incite an attempt at mass illegal migration into the adjacent Spanish enclave of Ceuta, a government spokesperson said.
In recent days, thousands of mostly young Moroccan men rushed to the northern city of Fnideq, bordering Ceuta, to attempt a crossing. Their efforts were thwarted by security deployment, Reuters reported.
"All attempts have been foiled," spokesman Mustapha Baitas said at a news conference late on Thursday.
"Some 3000 people attempted illegal migration," he said, in a first official comment days after the crossing attempt.
Videos shared by local media showed young people throwing stones at security forces as they were prevented from getting near the Ceuta border.
"No deaths have been reported," Baitas said, adding authorities acted in respect for the law.
In the first eight months this year, Morocco stopped 45,015 people from illegally migrating to Europe, according to interior ministry figures.
Last month, hundreds of migrants took advantage of a thick mist to swim to Ceuta, Spanish police said.
Tighter surveillance of Morocco's northern borders has prompted an increasing number of migrants to try the riskier and longer Atlantic route to the Canary Islands.