Chancellor Angela Merkel's cabinet approved a draft law on Wednesday aimed at preventing radical German Muslims from travelling to Iraq and Syria to fight for or train with groups like Islamic State.
It will also outlaw funding for recruits who try to travel to join the jihadists, her spokesman Steffen Seibert said.
The bill, when approved by parliament, will make Germany the second European Union member state after France to implement "foreign fighters" measures sought by the United Nations in a resolution last year, Seibert added.
German security services say about 600 German residents have joined IS and other similar groups in Syria and Iraq. Some returning fighters have been put on trial and others have been prosecuted for providing support.
"In recent days IS has been providing new examples of its murderous attitude," said Seibert. The law will make it a crime "to travel from Germany to a crisis zone to join a terrorism training camp or to take part in attacks or armed struggles".
Germany's top public prosecutor said in December the justice system was struggling to cope with waves of suspected jihadists returning from Syria and the speed at which young Muslims are being radicalised.
Federal Prosecutor General Harald Range said there had been a huge rise in cases of suspected membership of IS and al Qaeda, adding that Germany was "in the crosshairs of jihadist terror".