MADRID (AP) — A group of at least 40 migrants attempted to swim from Morocco into Spain’s North African enclave of Ceuta and threw stones at Spanish police, as top officials wrestled Wednesday with legal issues over what to do with hundreds of unaccompanied minors who got into Ceuta from Morocco three months ago.

Migrants trying to reach European soil swam around a fenced breakwater after nightfall Tuesday and confronted Spanish police, one of whom was slightly injured by a stone, local media reported.

Attempts to enter Ceuta by sub-Saharan migrants are not uncommon and have led to tension between Madrid and Rabat over whether Morocco is doing enough on its side of the border to stop them.

There is a wide buffer zone, policed by both Spain and Morocco, around the fenced breakwater.

Cooperation with Morocco is crucial for Spanish authorities trying to hold back large numbers of migrants who mass at the border and look for chances to get across. Spain is also under pressure from migrants trying to reach its Canary Islands by boat from northwestern Africa.

Last May, some 10,000 migrants descended on Ceuta, either scaling the border fence or swimming around it. Among them were hundreds of unaccompanied minors, who have been in Ceuta since then.

Earlier this month, Spanish authorities began sending the minors back to Morocco in groups, triggering an outcry from rights groups who argued it was illegal because the returns are done in groups, without prior warning and without a hearing or the provision of legal counsel.

A Spanish court suspended the returns pending legal arguments by the government, which insisted the returns were taking place under a 2007 agreement with Morocco for assisted returns once children’s cases had been considered.

But a court on Tuesday kept the prohibition in place, leaving officials uncertain about how to proceed.

Spanish Prime Minister Pedro Sánchez was meeting Wednesday in Madrid with the head of the Ceuta regional government in an effort to find a legal solution to the stalemate.

___

Follow AP’s global migration coverage at https://apnews.com/hub/migration