European Union interior ministers have reached a deal to share out 120,000 refugees across the European Union bloc after holding an emergency meeting.
The agreement was reached in Brussels on Tuesday despite fierce opposition from some central and eastern states that deepened rifts over Europe's worst refugee crisis in decades.
French Interior Minister Bernard Cazeneuve said the plan had been approved by a "crushing majority".
"This decision is a testament to the capacity of Europe to take responsibility and progress," he said.
Hungary, the Czech Republic, Romania and Slovakia all voted against the plan to share the intake of refugees, while Finland abstained.
"We will soon realise that the emperor has no clothes. Common sense lost today," Czech 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.
Hungary, the EU's toughest anti-immigration government, said it accepted the decision, but questioned its feasibility.
The deal mandates that countries in the EU take a share of thousands of new arrivals of refugees from the Middle East, Asia and Africa, who are currently in front-line EU states, like Greece and Italy.
The ministers were under pressure to reach a deal that could be ratified by EU leaders at a crisis summit on Wednesday, but in a rare step for a bloc that it is keen to show a united front, the agreement was by a majority vote instead of unanimity.
In Pictures: A window into a desperate journey
Officials said the relocation deal covered 66,000 refugees, who would be moved from Greece and Italy, plus another 54,000, who had previously been earmarked to be relocated from Hungary - before it refused to back the plan.
The opposition from the countries voting "no" has less to do with the numbers of refugees involved and more to do with the feeling that they are being bullied by Germany and Brussels, said Al Jazeera's Jacky Rowland, reporting from the EU headquarters.
"The European Commission says it will enforce the quotas but hasn't said exactly how it intends to do that."
The agreement came two days after Hungary gave its army and police sweeping new powers to keep refugees out, as the country's Prime Minister Viktor Orban warned that Europe was being "overrun".
Meanwhile, a Human Rights Watch report released on Monday accused the police in Macedonia of violence and ill-treatment of refugees streaming into the country from Greece on their way to northern Europe.
In Hungary, new legislation allowed the army on Monday to use coercive weapons designed to cause bodily harm, although in a non-lethal way, "unless it cannot be avoided".
The police, meanwhile, will be able to enter private homes for the purpose of carrying out a search for refugees who entered the country illegally, among other new powers.
Source: Al Jazeera and agencies