A Moroccan woman has died and three people were injured after the Moroccan navy opened fire on a speedboat with illegal migrants onboard.
The boat's driver, a Spanish national, refused an order to stop before the navy fired.
An official said those on board the powerboat were lying down and could not be seen.
The woman succumbed to her injuries in hospital, the official said, without giving further details.
The incident happened off Morocco's territorial waters, according to Morocco's official news agency MAP.
Morocco became the main launch pad for Europe-bound migrants in July after Italy took a tougher line and EU aid to the Libyan coastguard stemmed flows from Libya.
More than 38,852 people have crossed into Spain up to mid-September, UN data shows, at least twice as many as the same period last year.
So far this year, Moroccan officials said they foiled more than 54,000 crossing attempts to Europe.
Some 13% of those would-be migrants are Moroccans while the rest come from other African countries.
Since the beginning of September, social media networks in Morocco have been inundated with videos showing young people from Morocco heading to Spain aboard inflatable boats.