Seventeen people on board another ship and 249 rescued migrants already in Malta will also be divided up between the eight countries as part of the deal, Malta said.
Pressure on Malta to take rescued migrants has increased since Italy's populist government began turning them away on assuming power more than six months ago.
The 49 migrants, including a baby and several children, were rescued while attempting to make the treacherous Mediterranean crossing from North Africa to Europe.
In a press conference, Muscat confirmed that Germany, France, Portugal, Ireland, Romania, Luxembourg, the Netherlands and Italy have agreed to take in the migrants that had been rescued by the NGO vessels Sea Watch 3 and Prof.
Another 78 will be allowed to stay in Malta, while 44 Bangladeshi migrants will be repatriated.
Malta last week allowed the boats to shelter near its coasts from the bad weather but would not let them disembark the migrants.
Mr Avramopoulos said the fact that some of the migrants had to wait at sea for three weeks "is not what the European Union stands for".
"The risky, unseemly spectacle of politicians bickering whilst women, men and children are stranded in a sea of cruel indifference, must not be repeated", she said.
Italian Premier Giuseppe Conte has said that if Italy takes about 15 rescued migrant children and their parents that wouldn't "stain" the country's crackdown on accepting migrants rescued by private aid vessels.
"It is a testament to state failure; politics should never be played at the cost of people in need."
"We want to express our gratitude to. all cities, federal states and provinces that declared their ports open and their willingness to welcome people".
The migrants will be transferred to Maltese military ships that will bring them ashore.
The eight countries that will take them in include Italy, whose anti-migrant interior minister, Matteo Salvini, had vowed for days that none would reach Italian soil.
Some 113,482 migrants crossed the Mediterranean to reach Europe previous year, according to the United Nations refugee agency, which said 2,262 people lost their lives or went missing making the perilous journey.