In a Brussels meeting on Monday, the European Union ministers agreed to put in the motion the action to mobilise 32,000 migrants arriving on the coasts of Greece and Italy in October.
The fate of the redistribution of the 8,000 or so others will be decided by the end of the year, officials said.
An estimated 150,000 migrants have arrived around Europe this year, fleeing war-torn and impoverished countries.
Most immigrants have arrived in Greece and Italy where they are being housed in densely populated camps.
Both Italy and Greece have consistently called on other European Union member states to share the burden
The 40,000 figure emerged as a proposition from the European Commission after a shipwreck in the Mediterranean left 800 dead.
However, EU states have decided to help but are not unanimous in the details of the redistribution.
Luxembourg, in the meantime holds EU’s rotating six-month presidency, announced that EU home affairs ministers have decided for the relocation and redistribution of 32,256 Syrians, Eritreans, Iraqis and Somalis.
Commissioner for the EU’s home affairs Dimitris Avramapolous, speaking to reporters said that the 8,000 or so left over will be allocated too by the end of the year.
"I'm disappointed this did not happen today, but it was a very important step forward,"Avramapolous said.
Minister of home affairs for Spain Jorge Fernandez Diaz criticised the redistribution efforts, saying it may create a backlash ‘‘create a pull factor’’ showing Europe as a more attractive home to migrants.
Germany has been the most generous in offering room for migrant redistribution, and has agreed to open its doors to 10,500 for asylum seekers and 1,600 for migrants, and France comes straight behind with 6,752 places for asylum seekers and 2,375 for migrants.
The UK, Denmark and Ireland were not obliged to assist Europe in its efforts to share the immigration burden according to EU treatises, but Ireland will welcome 600 asylum seekers and 520 refugees, whereas Denmark and the Britain will take 1,000 and 2,200 refugees respectively.
Some 150,000 migrants and refugees have reached Europe crossing the Mediterranean and more than 1,900 of them have died in the sea so far this year, according to the International Organisation for Migration.