The Moroccan navy opened fire on a boat transporting migrants from the North African country, wounding one of them, a military source said on Wednesday.
Despite warning shots, "the motorboat that was carrying 58 migrants hidden under tarpaulin made a hostile move which forced the coastguard to fire at the captain," said the source in Rabat, who spoke on condition of anonymity.
One of the Moroccan migrants suffered a gunshot wound to the shoulder in the overnight operation to intercept the vessel off the town of Larache, on Morocco's Atlantic coast.
The wounded migrant -- aged 16, according to media reports -- was transferred to a hospital in Tangier, the military source told AFP.
The others aboard the boat, including men and women of various ages, were brought ashore and handed over to the security forces, the source said.
More than 43,000 migrants have made it to Spain since the start of the year, including around 38,000 by sea, according to the International Organization for Migration.
Last weekend alone, around 1,800 migrants trying to reach the European Union were rescued in the Mediterranean by the Moroccan navy and Spanish coastguard.
Since Tuesday, the Moroccan navy has rescued at least 452 migrants off the kingdom's Atlantic coast after they ran into trouble, the official MAP news agency reported, citing a military source.
That figure includes 86 Moroccans saved Wednesday from a faltering vessel off the coast Moulay Bouselham, south of Tangier, according to the same source.
Wednesday's shooting was the second of its kind in two weeks.
On September 25, a Moroccan naval patrol opened fire on a "go-fast" speedboat ferrying migrants to Spain, killing a 22-year-old student and wounding three other people.
The authorities said that shooting was also in response to the boat's "hostile manoeuvres" and said the migrants had been concealed under tarpaulin.
A growing number of Moroccans are trying to leave their country illegally to reach Europe by sea or by crossing the fortified barriers between Morocco and the Spanish enclaves of Ceuta and Melilla in North Africa.
The kingdom is also a transit country for thousands of migrants from sub-Saharan Africa.