The plan, worth €2bn in total, was agreed in Brussels on Monday.
Ukraine had told the EU it needed 350,000 shells a month to hold back advancing Russian troops and launch a counter-offensive this year.
Ukrainian Foreign Minister Dmytro Kuleba hailed the “game-changing decision” from the EU.
“Exactly what is needed,” he wrote on Twitter. “Urgent delivery and sustainable joint procurement.”
The deal comes as Russia grows concerned at a Ukrainian counter-offensive near Bakhmut or in southern Ukraine, according to a report from think tank Institute for the Study of War.
Meanwhile, Russia’s own new year offensive “may be nearing culmination”, the ISW added.
Defence and foreign ministers from 17 EU countries and Norway signed the ammunition agreement.
The first part of the plan commits €1bn ($1.06bn; £863m) of shared funding for EU states to draw upon their existing stockpiles, with the hope of sending this to Ukraine by the end of May.
The second part of the deal would see a further €1bn used to jointly order 155mm shells for Ukraine – the most sought-after artillery rounds.
The EU is hoping this joint order will incentivise European defence firms to increase their output, with the hope that contracts can be signed by the start of September.
The deal means each country will have to share details of their ammunition stockpiles – something normally kept secret.
Current ammunition production in Europe is said to be lagging behind the levels Ukraine insists it needs to fight Russia.
There are also questions about how much EU countries can share from their own stockpiles without leaving themselves vulnerable.
“Increasing industrial capacity is essential,” EU internal market commissioner Thierry Breton said during a visit to French arms industry company Nexter on Monday.
EU foreign policy chief Josep Borrell recently warned that the bloc had to supply the artillery shells Ukraine needed, or face the prospect of Ukraine losing the war with Russia.
He said Russian forces were firing about 50,000 rounds of artillery each day and that Ukraine’s supplies must be lifted to the same level.
Hungary, which has not sent ammunition to Ukraine and has often threatened to veto sanctions against Russia, abstained from Monday’s vote in Brussels but foreign minister Peter Szijjarto said it would “not prevent others from doing what they want”.
Norway also announced on Monday that it had delivered eight German-made Leopard II tanks to Ukraine to be used in a possible Ukrainian counter-offensive against Russia this spring.
Separately, the US is authorising another $350m in military aid for Ukraine, Secretary of State Antony Blinken said. It includes ammunition for Himars missile launchers, 155mm shells, and howitzer cannon.