Mauritanian and Spanish health personnel had set up a makeshift treatment centre in the port of Nouadhibou to assist the migrants, some of whom were reported to be suffering from diarrhoea and sea-sickness.
Mohamed Yahya Ould Mohamed Vall, the governor of Nouadhibou, said six of the migrants were evacuated to nearby hospitals by the local Red Cross.
He said: "
Only the sick who require hospitalisation will be allowed to stay at Nouadhibou and after they get well, they will be sent to Spain and out of Mauritania to their country of origin."
After identity checks, the migrants were due to be escorted by Spanish police officers to planes which would either repatriate them to their countries of origin - if these could be established - or fly them to
Spanish territory where their immigration status would be decided, diplomats said.
Mauritania had initially refused to accept the wooden boat, known as the Marine 1, which is believed to have set sail from Guinea and was heading towards Spain's Canary Islands.
The ship sent out an SOS signal after its motors broke down in international waters off Senegal on February 2 and was intercepted the next day by the Spanish coastguard which towed it close to Mauritania's fishing port of Nouadhibou.
The Marine 1 has become a test case for Spain, which launched a diplomatic offensive in West Africa last year in a bid to stem soaring illegal migration from the poverty-stricken region to the Canaries.
Madrid has been offering increased aid in return for help to halt clandestine migration.