The claim was made in an audiotape obtained by Al Jazeera on Tuesday.
"Two units of the valiant mujahedeen managed to kidnap four Europeans in two distinct operations:
the first in Mali where Frenchman Pierre Camatte was seized on November 25, and the second in Mauritania where three Spaniards were held on November 29," the spokesman, who identified himself as Saleh Abu Mohammad, said on the tape.
He added that "France and Spain will be informed later of the legitimate demands of the mujahedeen", but did not go into detail about the demands.
Camatte, the kidnapped Frenchman, was snatched from a hotel in the Sahel region of northern Mali on the night of November 25.
The three kidnapped Spaniards were working as volunteers in Mauritania delivering humanitarian aid when they were kidnapped on November 29.
They have been named as Albert Vilalta, 35, Alicia Gamez, 35, and Roque Pascual, 50.
Earlier this year a US-based monitoring group reported that AQIM had claimed responsibility for killing Briton Edwin Dyer, one of a group of six Westerners kidnapped in Niger in January.
The group had said threatened to kill Dyer unless the British government released Abu Qatada, a Muslim cleric, from a UK prison.