The law will require companies to produce a due diligence statement showing their supply chains are not contributing to the destruction of forests before they sell goods into the EU - or they could face hefty fines.
"I hope that this innovative regulation will give impetus to the protection of forests around the globe and inspire other countries at the COP15," said the European Parliament's lead negotiator, Christophe Hansen.
Deforestation is responsible for about 10% of global greenhouse gas emissions that drive climate change and will be in focus at a UN COP15 conference this week, where countries will seek a global deal to protect nature.
Negotiators from EU countries and the European Parliament struck the deal on the law early on Tuesday.
It will apply to soy, beef, palm oil, wood, cocoa and coffee, and some derived products including leather, chocolate and furniture. Rubber, charcoal and some palm oil derivatives were included at the request of EU lawmakers.
Companies would need to show when and where the commodities were produced and "verifiable" information that they were not grown on land deforested after 2020.
Failure to comply could result in fines of up to 4% of a company's turnover in an EU member state.
Countries that will be impacted by the new rules, including Brazil, Indonesia and Colombia, say they are burdensome and costly. Certification is also difficult to monitor, especially as some supply chains can span multiple nations.
In Brazil, the country responsible for the most deforestation, some environmental advocates praised the law, while also saying it did not go far enough. The law did not extend protection as they hoped to "other wooded land" that has trees but is not a dense, closed forest.
That means 600,000 square kilometres of woodland in the Cerrado savanna - the fastest growing frontier of agricultural expansion in Brazil - would not be subject to the law, according to the Brazilian non-profit Cerrados Institute. That's an area roughly as big as Ukraine.
"The European Union thinks it's alright to consume products linked to losses of the most biodiverse savanna on the planet? That doesn't seem smart," said Yuri Salmona, director of the Cerrados Institute.
The EU said in a statement it will review whether to add protections for "other wooded land" in one year and other critical ecosystems in two years.
Brazilian and European campaign groups also criticised its requirement for companies to prove they respected the rights of indigenous people - but only if those rights are already legally protected in the producer country.
Brazil's Foreign Ministry responded to questions by referring to a previous statement that it was concerned that environmental protection could be used as a pretext for unilaterally imposing discriminatory trade restrictions. The ministry said it was awaiting the publication of the full text of the law for further examination.
Global Environmental Concerns
The country's coffee exporters association Cecafe said it respected global environmental concerns but worried the industry's progress toward sustainable production was not being adequately recognised.
EU countries and the European parliament must now formally approve the legislation. The law can enter into force 20 days later, after which large companies have 18 months to comply, and smaller firms 24 months.
EU member nations will be required to carry out compliance checks covering 9% of companies exporting from countries with a high risk of deforestation, 3% from standard-risk countries and 1% for low-risk countries.
The EU said it would work with affected countries to build up their capacity to implement the rules.