Chancellor Angela Merkel's cabinet agreed on Wednesday to expand the role of the German navy in the Mediterranean Sea to include efforts to stop arms headed to Islamic State militants in Libya, government sources said.

The German decision comes days after the European Union gave its naval force the authority to search suspicious vessels as part of its five-frigate "Sophia" mission, which is also seeking to break up gangs smuggling migrants to Europe.

Parliament is expected to approve the move before it adjourns for the summer at the end of June, the sources said. The mandate also covers work to help Libya build up a coastal patrol and navy.

Germany has thus far participated in the EU mission with a logistics ship, and about 950 German soldiers have helped rescue about 15,000 people at sea since May 2015, according to the German military.

Once approved by parliament, Wednesday's decision means German ships will be able to stop, search and seize larger vessels used by gangs transporting migrants, and also take suspects into custody, the sources said.

In cases of suspected arms smuggling, they will also be able to search ships transiting to and from Libya, they added.

Merkel often underscores the need to improve conditions in countries like Libya to help end the current migrant crisis.