Updated

Germany's governing parties have agreed on new rules to ensure that most marriages involving under-18s aren't legally recognized in the country.

The issue arose following the influx of migrants to Germany in 2015, and the main aim is to protect girls who were married abroad.

The bill calls for all marriages involving under-16s to be considered null and void. In principle, marriages involving people between 16 and 18 also won't be recognized, but courts will decide on a case-by-case basis whether to nullify them after hearing from youth protection authorities.

Leaders of Chancellor Angela Merkel's coalition agreed Thursday on the bill, which needs Cabinet and parliamentary approval.

Justice Minister Heiko Maas said: "We must not recognize any marriage that has been a nightmare for young girls and women."