The compromise between the European Parliament, the Spanish EU Presidency and the European Commission is a step towards ensuring that illegally harvested timber and wood products cannot be sold on the EU market.
It is estimated that 20-40% of global industrial wood production comes from illegal sources, with up to 20% ending up on the EU market.
The agreement covers raw timber and wood products like furniture and floorboards. But it exempts printed materials such as books and newspapers for at least five years.
Companies will be required to use a due diligence system and carry out risk assessments where illegal activities are suspected. Furthermore, they will have to trace back the timber they use to the country and place where it was harvested.
Member states will also carry out checks on operators on a regular basis.
"For years the EU has preached against illegal timber, a major driver of deforestation worldwide, but has hypocritically continued to provide one of the biggest markets for it," said Finnish Green MEP Satu Hassi, who steered the legislation through Parliament.
She added that she was "delighted" that the Parliament had managed to secure "fundamental improvements" to the new rules.
One point on which the EU assembly prevailed was agreeing on fines and sanctions for companies who fail to adhere to the rules. Environmentalists, however, regretted the weakness of the sanctions as national capitals rejected a minimum framework of penalties which would be applied across Europe. Instead, it will be left to member states' discretion how strict the penalties should be.
Most member states backed the agreement, with the toughest opposition coming from Sweden and Portugal which both have a strong forestry industry.
The legislation will now have to be formally endorsed by the Parliament, which is set to vote on the text in July. EU governments will approve it this autumn. If approved, it is scheduled to enter into force in 2012.
"The world's largest market is about to shut its gates to companies profiting from illegal trafficking and forest destruction. With this law, the black economy for wood products in Europe will be closed for business, levelling the playing field so companies are better able to act sustainably," said Sébastien Risso, Greenpeace EU's forest policy director.