They agreed to start relocating more than 32,000 of them around the 28-nation EU but fell 8,000 short of their overall target agreed by EU leaders at a bad tempered summit in June.
"We have a solution for relocation in this year. For next year we are not yet exactly there, we will talk about this in October or November," German Secretary of State Emily Haber told reporters after the talks.
The European Commission, the executive arm of the EU, originally proposed the 40,000 figure after an unprecedented migrant shipwreck in the Mediterranean in April that left nearly 800 people dead.
Luxembourg, which holds the rotating six-month presidency of the EU, said the ministers agreed to relocate 32,256 Syrians and Eritreans who had landed in Greece and Italy.
More From This Section
It added that they also agreed to relocate 22,504 Syrian refugees currently living in camps outside the EU.
More than 1,900 migrants have died this year making the perilous journey across the Mediterranean to Europe, while around 150,000 people have made the crossing, the International Organization for Migration said earlier this month.
Other governments -- including those in central and eastern Europe -- objected to earlier EU proposals to establish mandatory quotas in meeting the targets.
EU sources said the countries that were most reluctant to admit migrants were Hungry, Austria, Slovakia, Slovenia, the Baltic countries and Spain.