Eighteen migrants have died and others were injured when a huge crowd tried to cross into Spain's North African enclave of Melilla, officials from neighbouring Morocco say.
Reports say some of those who died had fallen from the top of a border fence.
Several security personnel and migrants were admitted to hospital for treatment following clashes early on Friday.
It was the first such attempted mass crossing since Spain and Morocco resumed diplomatic ties in March.
The thaw in relations came after Spain supported Morocco's autonomy plan for the disputed region of Western Sahara.
Spanish officials say several hundred people tried to break through into the enclave after cutting fencing.
Most were forced back but more than 100 got through and were being processed at a reception centre, they added.
Melilla and Ceuta, another Spanish enclave, have in recent years become a focal point for mostly sub-Saharan migrants attempting to reach Europe.