The measures include stricter rules on buying and owning semi-automatic weapons, steps to stop deactivated guns being put back into use, and better tracing of trafficked weapons.
Semi-automatic weapons that can easily be converted to deadlier fully automatic mode would be prohibited. Tighter controls would also be placed on internet gun sales.
French Interior Minister Bernard Cazeneuve welcomed the agreement, saying it "will allow the security of citizens to be improved thanks to a stronger legal framework and the increased traceability of firearms at the European level."
Dutch Justice Minister Ard van der Steur said the new measures mean that "the risk of legal firearms finding their way to the illegal market is reduced."
The rules would set minimum standards for EU nations to respect but do not stop them putting tougher laws into place. EU lawmakers must endorse the rules before they can come into force.
The EU presidency struggled to strike the right balance between cracking down enough and avoiding impeding hunters and sports shooters.
Van der Steur said some thought the compromise went too far, others not far enough, but that in the end it was important to act.
"What we've seen in the terrorist attacks is that some of the firearms used were originally deactivated legal firearms that were reactivated again," he told reporters after chairing the EU talks in Luxembourg.
On Tuesday, Italian police arrested two leading members of a Mafia clan for weapons smuggling. The suspects had bought more than 160 decommissioned firearms from Slovakia that could easily be put back into action, according to the EU's police agency Europol. Some had already been reactivated and sent to Malta.
