Moroccan authorities have stopped boats carrying 117 sub-Saharan migrants from crossing to Europe and arrested 40 people trying to scale a fence into Spain's North African enclave of Melilla.

A military official told The Associated Press on Monday that the Moroccan navy prevented three boats from sailing Saturday across the Mediterranean. It was unclear where the migrants onboard were taken.

Meanwhile, a police official in the northern Moroccan city of Nador said 40 migrants were arrested Sunday while storming a razor-wire fence into Melilla. Another group of 52 migrants managed to cross into Spain.

Clashes left seven security forces and two migrants injured on the Moroccan side, the official said.

Both officials were not authorized to be publicly named according to government policy.