MADRID, Spain — Dozens of migrants trying to reach Europe spent three weeks adrift off the coast of West Africa and threw nearly 50 bodies overboard as their vessel lost power and supplies dwindled, officials said Tuesday.

The boat, which set out from Senegal with as many as 150 people and apparently traveled hundreds of miles, was found Tuesday by a Mauritanian patrol boat, a Spanish Civil Guard official said. It was one of the highest death tolls this year among Africans trying to escape poverty and reach Europe's southern gateway.

When the vessel was found, there were 100 people aboard and two dead bodies, the official said under department rules barring her name from being published.

In Mauritania, officials agreed that there were 98 survivors, but otherwise offered slightly different numbers.

Yahfdhou Ould Amar, chief of police for the northern port city of Nouadhibou, said 45 people died in the voyage — presumably from hunger, cold and thirst.

The boat apparently set sail from southern Senegal on Oct. 16 with 143 people aboard, then was intercepted by authorities on the Moroccan coast after its motor failed, Amar said.

The survivors were exhausted, and many appeared to be in shock, said Mohamed Ould Hamada, head of the Mauritanian branch of the Red Cross in Nouadhibou. He said the U.N. and other international groups had dispatched teams to help the survivors.

Most of the group were Senegalese, along with some from Mali, Guinea-Bissau and Gambia, Hamada said. They told relief workers that the capitan of the boat had perished.

Hundreds of migrants seeking a better life in Europe die each year while attempting to reach Spain by sailing in simple wooden fishing boats from West Africa to Spain's Canary Islands, just off Morocco's coast. The trip often takes more than a week.

In July, some 50 migrants died off the coast of Africa when their boat capsized just as a Spanish patrol vessel tried to come to its aid. In December, 80 others died when their boat sank off Senegal's coast.

Spain says increased air and sea surveillance of Africa's coast has led to a sharp drop in the number of people attempting the journey.

While 24,000 people were caught trying to sail to Spain last year, as of late August the figure was down to 8,000, according to the Interior Ministry.