The 27 European Union member states agreed on the draft law during a meeting of environment ministers in Luxembourg.
The European Commission, the E.U.'s executive arm, proposed the law last year that would compel member states to put in place measures to restore at least 20 percent of the E.U.'s land and 20 percent of the E.U.'s seas by 2030.
The draft also stipulates there must be similar measures for all damaged ecosystems including forests in need of restoration by 2050.
Under the proposal, aligned with the historic biodiversity agreement signed at COP15 last year, E.U. states should take measures by 2030 to restore 30 percent of habitats in ecosystems that are in a bad condition, then 60 percent by 2040 and 90 percent by 2050.
In the E.U. parliament, right-wing and far-right lawmakers are fiercely opposed to the draft law that they say could threaten agricultural production.
The largest party in the parliament, the EPP, failed to stop the law's approval last week but it will be subject to a tight vote by the body in July, putting at risk the possibility of starting talks between member states and MEPs to approve a final law.
Swedish Environment Minister Romina Pourmokhtari said Sweden, which holds the rotating EU presidency, "believes that we have now found the right balance."
"It's a good law," her German counterpart, Steffi Lemke, said. "It is clear that agriculture and the forest economy depend on nature remaining intact."
The agreement waters down some of the initial proposals with greater flexibility, but it was still welcomed by environmental groups.
But the concessions were not enough to convince some member states like Austria, Belgium, the Netherlands, Poland and Sweden, who refused to back the law.
Scandinavian countries have concerns over the impact on the powerful forestry industry while the Netherlands wanted greater consideration for intensive farming areas or densely populated regions.