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 — a 16-year-old 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 had come to the aid of 15 inflatable boats carrying 366 migrants after they ran into trouble, the official MAP news agency reported, citing a military source.
The latest shooting was the second of its kind in two weeks.
On September 25th, 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 pointed out that the migrants were concealed under tarpaulin.
A growing number of Moroccans are trying to leave their country illegally to reach Europe by sea or by crossing the wire fencing 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.