The emergency talks came amid deep divisions over how to handle the continent's worst migration crisis in decades.
The ministers agreed by a large majority to the plan with just four EU members voting against it and Finland abstaining.
The UN and other international organizations warned it was the “last chance” for increasingly overwhelmed European states to agree on how to cope with the tide of people fleeing conflict in countries like Syria, Afghanistan.
Italy and Greece have borne the brunt of the Mediterranean crisis, and have since established 'hot spots' to help them process asylum applications faster, in the wake of criticism from their EU partners.
Italian Foreign Minister Paolo Gentiloni said on Tuesday that the refugee crisis was not a 'daily emergency' but a 'mid to long term phenomenon'.
He also criticized the behavior of Hungary, which he branded “terrifying”.
The minister called it “a slap in the face to all of us who believed in the enlargement of the European Union,” Ansa news reported.