Five African migrants died on Thursday as hundreds stormed a razorwire fence between Morocco and a Spanish enclave, the third assault in as many days on Europe's only land borders with Africa.
"(The assault) cost the lives of 5 people - two on Spanish soil and three in Morocco," Spanish Deputy Prime Minister Maria Teresa Fernandez de la Vega told reporters at a Moroccan-Spanish summit in Seville.
She declined to comment on reports that migrants were shot at but ordered an investigation, saying Spain would announce measures on Friday to deal with the sudden upsurge in efforts by migrants to force their way into its two North African enclaves.
Authorities in the outpost of Ceuta said two of the dead were either crushed in a stampede or fell, with 30 others injured in their desperate bid to reach Europe.
Jemmah Khalil, chairman of Friends and Families of Illegal Immigration Victims Association, a Moroccan immigrant advocacy group, said the migrants came under fire as they tried to scramble over the barrier under cover of darkness.
"Bullets have been fired into the migrants storming the fence to force their way onto Spain," he told Reuters, quoting his group's activists in the area. However, he said he did not know who had fired into the crowd nor the exact causes of death.
Jeronimo Nieto, Madrid's top official in Ceuta, told state radio: "We've never seen numbers like this before - a group this big and so organised and co-ordinated."
As concern grew in Spain about the growing flood of illegal migrants - many of whom cannot be sent home if they make it in - Defence Minister Jose Bono told parliament the army would now reinforce border police in Ceuta and Madrid's other North African enclave of Melilla, 200 km (125 miles) to the east.
Immigration dominated talks between Spanish Prime Minister Jose Luis Rodriguez Zapatero and Moroccan counterpart Driss Jettou in the southern Spanish city of Seville on Thursday.
A spokeswoman for the European Commission described events in Ceuta as "a tragedy" which highlighted the need for a common immigration policy in the 25-nation bloc.
Spanish Foreign Minister Miguel Angel Moratinos urged the EU to help not only Spain with the problem, but Morocco too.
The assault on Ceuta followed two nights of similar disturbances at the razorwire fences sealing off Melilla.
Two fences, both 10 km (6 miles) long, surround the enclave with a narrow "no-man's land" between them. Both are topped with coils of sharp wire and are guarded on the Spanish side.
Migrants have long tried to use Melilla and Ceuta as a gateway to a better life in the wealthy European Union but these are by far the biggest assaults on the enclaves, which Spain has owned since the 15th century.
Thousands also try to make it by boat over the Mediterranean to southern European countries, but many die en route.
It was unclear how many migrants entered Ceuta on Thursday. In Melilla this week, Spanish civil guards in riot gear repelled most of the nearly 1,000 migrants trying to scramble over the fence using makeshift ladders, but around 300 got in.
Morocco, which claims both Spanish enclaves, is struggling to deal with an influx of sub-Saharan Africans into its territory and to curb attempts by migrants to use sea routes to cross to Spain illegally.
Under a bilateral agreement, Spain can send back Moroccan illegal immigrants but it lacks repatriation agreements with many African countries.
The Spanish therefore often have no choice but to free these migrants once they reach Spanish soil after handing them an expulsion order which the authorities cannot enforce.
Juan Jesus Vivas, head of Ceuta's local government, urged Madrid to work towards a deal with Rabat which would allow Spanish authorities to send sub-Saharan migrants back to Morocco rather than their country of origin.
Relations between Spain and Morocco were often strained under the former centre-right government of Prime Minister Jose Maria Aznar.
They hit a low in 2002 when Aznar ordered the military to capture a disputed and uninhabited islet off the Moroccan coast that had been occupied by Moroccan troops.
Last year's Madrid train bombings brought relations between the two countries under the spotlight as most of those suspected of carrying out the attacks were Moroccan.
Ties have improved greatly under Zapatero's Socialist government, which took power days after the bombings.