Europe has shouldered responsibility for the wave of refugees and migrants reaching its shores, French President Francois Hollande said.
"Europe has taken on its responsibilities. It has been able to do this but with conditions and with rules, and that is what France has called for," Mr Hollande said.
Europe has been struggling to coordinate a united response to an unprecedented influx of migrants and refugees from war-torn countries such as Syria.
"Couldn't we manage 120,000 in a continent with 450 million people? We will show that we can do this, and at the same time have rules. That is taking responsibility, that is solidarity," Mr Hollande added.
The plan to relocate 120,000 people was opposed by the Czech Republic, Hungary, Romania and Slovakia, who argue that the European Commission does not have the right to make them take in people seeking refuge.
Asked about the possibility of sanctions for countries which did not respect today’s agreement, Mr Hollande said Europe had "rules".
"When you are in the European Union, it comes not just with benefits, it also means playing your part, especially when it comes to accommodating people who are in an extremely difficult situation," he said.
The agreement came on the eve of a key EU summit tomorrow which is dedicated to finding ways to help countries to stop the flow of asylum seekers at sources.
Mr Hollande's remarks came as the first refugees from Syria arrived in Britain, which is exempt from EU asylum and migration policy.
British Prime Minister David Cameron has agreed to accept 20,000 refugees by 2020, from camps in countries bordering Syria such as Turkey and Jordan.
At today's emergency meeting in Brussels, ministers opted to put the latest draft proposal to a vote under the Qualified Majority Vote mechanism, under which member states do not have a veto.
The vote was approved by a large majority.
The Czech minister tweeted that he had voted against, along with colleagues from Slovakia, Romania and Hungary, with Finland abstaining.
The Czech government had earlier warned that any attempt to impose such a scheme would be unworkable and could end in "big ridicule" for governments and EU authorities.
"We will soon realise that the emperor has no clothes.Common sense lost today," Interior Minister Milan Chovanec tweeted after the vote.
Slovak Prime Minister Robert Fico said pushing through the quota system had "nonsensically" caused a deep rift over a highly sensitive issue and that, "as long as I am prime minister", Slovakia would not implement a quota.
Since Ireland has an opt-out on EU law governing justice and asylum policy Minister for Justice Frances Fitzgerald did not have a vote.
Minister Fitzgerald has said the first refugees could arrive in Ireland within weeks pending the approval of the Dáil and the Seanad.
Ministers met to decide how to relocate across other member states up to 120,000 refugees who have arrived in frontline countries, such as Greece and Italy.
The relocation plan put forward two weeks ago by the European Commission originally envisaged a mandatory redistribution system.
It is the second emergency meeting of EU justice ministers in just over a week.
French Interior Minister Bernard Cazeneuve said the plan had been approved by a "crushing majority".
"This decision is testament to the capacity of Europe to take responsibility and progress," he said. f
But a diplomat from one of the countries opposed to the plan described the atmosphere around the council table as "terrible", adding: "This is a bad day for Europe."
The Qualified Majority Vote was extended to the so-called Justice and Home Affairs part of the EU law in the Lisbon Treaty. It is rarely used as the council of ministers prefers to reach consensus on sensitive issues.
Meanwhile, new President of the United Nations General Assembly Mogens Lykketoft has said that all countries must contribute to solving the refugee crisis.
Mr Mogens comments come after UN Secretary-General Ban Ki-moon urged European leaders yesterday to ensure refugees and migrants are treated properly as many of them have endured arduous journeys to flee persecution, conflict and human rights abuses.
Mr Ban will hold a meeting on 30 September on the challenges of the increased movements of refugees and migrants while world leaders are gathered at the United Nations.