Libya's navy warned it will seize activists' boats on migrant rescue missions that enter its waters unauthorized, after a run-in Wednesday with a German vessel during which a warning shot was fired.

"This time we avoided an escalation. In future, we will seize the boats of NGOs that do not respect Libya's sovereignty," said navy spokesman Gen. Ayub Kacem.

The Libyan coast guard earlier boarded a boat operated by Germany's "Mission Lifeline" that had picked up 52 migrants at sea. "You are not welcome here," a coast guard official said in a videotape posted on the internet by the NGO.

"They threatened us by telling us to hand over the people, which we refused," said the group's head Axel Steier, contacted by AFP.

"It was a real act of piracy because they boarded our boat without any authorisation," he said.

Kacem said the boat had tried to flee with a coast guard official still on boat. "Our patrol fired in the air to force the NGO boat to stop," the general said.

"These NGOs must respect our authority and our sovereignty. Our patience has reached its limit," he added.

In August, the navy ordered foreign vessels to stay out of a coastal "search and rescue zone" for migrants headed for Europe, a measure it said targeted NGOs.

Six years since a revolution that toppled longtime dictator Moamer Kadhafi, Libya has become a key departure point for migrants risking their lives to cross the Mediterranean to Europe.

Tens of thousands of migrants have resorted to paying people traffickers for the journey, often on overcrowded and unseaworthy boats.

Charities have dispatched boats to rescue migrants from drowning, while Libya and Italy -- where the vast majority land -- have worked together to stem the flow.