But in a sign of deep-rooted divisions among the bloc's 28 nations, the ministers who often reach decisions by consensus had to put the plan to a vote. And even with Tuesday's hard-won agreement, the sheer numbers of migrants already in Europe this year — over 477,900 — shows the need for much greater action and wider vision down the road to resolve the migration crisis.
Milan Chovanec, the Czech Republic's interior minister, said four nations — the Czech Republic, Slovakia, Romania and Hungary — all voted against the plan and Finland abstained.
"(It's) a bad decision and the Czech Republic did all it could to block it," Prime Minister Bohuslav Sobotka said.
The deal on Tuesday did not set mandatory quotas for each nation — one of the most controversial aspects of the proposed plan.
EU Commission First Vice President Frans Timmermans sought to put a positive spin on the vote, saying it showed the bloc is "capable of taking decisions even if, for some member states, these are very difficult decisions."
"This decision is an important, essential building block in what is a much larger approach we will have to take," Timmermans said. But he conceded that "by itself, the decision we took today is not going to solve the refugee crisis."
Now, he said, the EU has to do a better job of protecting its borders, registering migrants who arrive, quickly returning people who are not eligible for asylum and "providing hope and perspective" in conflict-torn countries from which many of the migrants flee.
EU leaders will gather in Brussels on Wednesday night to discuss those measures and attempt to adopt a unified approach to the migrant crisis.
German Interior Minister Thomas de Maiziere said his country would take more than 30,000 of the 120,000 people.
"We are doing this out of solidarity and responsibility, but also in our own interest," he said. "At the moment, something like 50 percent of those who are arriving in Greece are coming to Germany. With a quota of 26 percent, fewer of this group would come."
De Maiziere said the deal also aims to cut "secondary migration," in which those seeking asylum move from one country to another within Europe.
"If people are distributed in Europe, then they can't choose what country they go to. They have to stay in the country they were distributed to," he said.
Hours before the ministers talked in Brussels, migrants scuffled with police at a transit camp in Croatia and nations in southeast Europe scolded and threatened each other as the unrelenting flow of asylum-seekers raised diplomatic tensions to a boiling point.
The United Nations' refugee agency said the next few days may be the last chance for a coherent European response as hundreds of thousands flow from war-torn areas in the Middle East, Africa and Asia to Europe.
The U.N. High Commissioner for Refugees warned that the proposal on the table isn't enough to stabilize the situation, because 477,906 people have already entered Europe by sea this year. It urged the EU to quickly set up facilities in Greece, where tens of thousands have arrived after making the hazardous sea crossing from Turkey.
This may be "the last opportunity for a coherent European response," said Melissa Fleming, a spokeswoman for UNHCR.
Tensions between Serbia and Croatia took a sharp turn for the worse, with Serbia giving Croatia an ultimatum to reopen its border — or risk unspecified counter- measures. Croatia shut down all but one of its border crossings with Serbia last week to block the flow of migrants, which has now reached 34,900 in less than a week. But the action is crippling Serbia's economy, which transports cargo across Croatia to reach much of Europe.
On Tuesday afternoon, Croatia started letting trucks carrying foodstuff from Serbia cross the border, but Serbian Prime Minister Aleksandar Vucic, who wants all cargo traffic restored, said that was not enough.
Earlier, Vucic called an emergency session of all security services, including the military, to discuss the crisis. The two nations have a tense history after fighting bitterly in the Balkan wars of the 1990s.
"This is a scandal of international proportions," Vucic said. "Croatia has breached all European agreements and directives."
Croatia, angry that Serbia was busing migrants to its border, seemed unlikely to honor any Serb demand.
"Mix it up a little," Croatian Prime Minister Zoran Milanovic said. "Send them a bit to Hungary and Romania."
In Greece, bad weather created more misery as thunderstorms drenched hundreds who had been camping out in a main square in Athens.
"We have nothing. No water, no food, no shelter. We are living in tents, we need help," said Mohamed Saber Nazari, a 20-year-old Afghan camping in Victoria Square. "You see all the families living in the rain, with small children? Something must be organized for us."
A local taxi driver sympathized with the migrant's plight. Adrian Mustafa, 45, had walked to Greece from Albania more than 20 years ago and has been living in the country since then.
"If you go through what these people are going through, only then will you understand," he said. "They don't want to stay here, but they live under bad conditions."