The EU's 28 member states announced it had reached a political agreement with the European Parliament that will tighten laws in place since 1991.
"This agreement provides for tighter controls which will help prevent the acquisition of firearms by terrorist and criminal organisations," said Slovak Interior Minister Robert Kalinak, whose country holds the rotating EU presidency.
The directive includes measures to make it easier to trace firearms, including standardised marking of components and requiring prompt electronic registration of weapons sales, with information kept in national data files.
The European Council, which groups the EU member states, noted that the Islamic State fighters who launched the Paris attacks in November last year had converted blank firing weapons back to the original lethal ones.
More From This Section
The directive, which still must be voted on by parliament, bans short semi-automatic firearms with loading devices over 20 rounds and long semi-automatic firearms with loading devices over 10 rounds.
Also prohibited are long firearms that can be folded or concealed in other ways.
It also regretted it did not get a ban of assault weapons for private collectors or a magazine size limit of 10 rounds for all semi-automatic firearms.
But commission chief Jean-Claude Juncker said it was a major improvement over the current situation and would reduce the risk of terror or other attacks from legally held firearms.
"Of course we would have liked to go further, but I am confident that the current agreement represents a milestone in gun control in the EU," Juncker said.