Six migrants have been shot dead in clashes with Moroccan troops after trying to cross a fence around the Spanish enclave of Melilla.
Spain has sent reinforcements to the border fence
Moroccan news agency MAP quoted a government official as saying that the troops opened fire in self-defence.
The deaths came as Spain and Morocco finalised plans to start expelling immigrants who had illegally entered Melilla and the other enclave of Ceuta.
Seventy immigrants were sent to Morocco in the first set of expulsions.
They were flown to mainland Spain before being taken by boat to Morocco.
Hundreds of migrants have stormed the barbed wire fences surrounding the enclaves in recent weeks.
'Stepping stone to Europe'
The governor of Morocco's northern Nador province, Abdellah Bendhiba, told MAP that the six men died during an "assault of rare violence" by some 400 immigrants trying to enter Mellilla overnight.
The governor said that 290 migrants had been arrested.
Last week, five other migrants were killed trying to get into Ceuta.
But Spain's Interior Minister Jose Antonio Alonso said an internal investigation had confirmed that Spanish troops did not fire the shots that killed them.
The deaths and the attempted crossings are part of a sustained bid by thousands of mainly sub-Saharan Africans, living in tents on the Morocco side of the border, to reach Spanish territory - seen as a stepping stone to Europe.
Hundreds have made it across, thousands more have been repelled.
The crossings have prompted reinforcements to the physical barriers, and to the police and army patrols along the perimeter.
The plan to return those who do get across revives a 1992 accord with Morocco to allow expulsions of illegal entrants back to Morocco, even if they are of different nationalities.
The agreement has never before been implemented.
The BBC's Pascale Harter in Rabat says it is unclear what will happen to the immigrants once in Morocco, as most are of West and Central African origin and are already illegal there.
The United Nations has warned against any harsh treatment.
Spanish Prime Minister Jose Luis Rodriguez Zapatero has said urgent work is needed to reduce the poverty gap between Spain and Morocco.
He said the root of the problem was drought and famine affecting sub-Saharan Africa.
At Spain's request, the EU has agreed to send a delegation to study the situation in Ceuta and Melilla from both sides of the border.