Police arrested a man after the plane landed
Police arrested the man soon after the Boeing 737 landed at Gando military base in Spain's Canary Islands.
The hijacker seized the jet shortly after take-off from Mauritania's capital, Nouakchott. Police said he was armed with two handguns.
The hijacker's motive was not known but officials in Spain and Mauritania said he had demanded to be flown to France.
In-flight ordeal
Seventy-one passengers - mostly Spaniards and Mauritanians - and eight crew were on the plane, reports from Spain said.
All were released after the flight landed safely at the military strip near Las Palmas city's international airport.
Twenty-one passengers were injured in the incident, including a pregnant woman who was treated for severe shock.
"It has been liberated," the Associated Press news agency quoted foreign ministry spokesman Manuel Cacho as saying. "The hijacker has been detained."
The plane took off from the north-west African nation in the late afternoon.
It tried to land at Dakhla, in Western Sahara, but Moroccan authorities refused permission, security officials said.
The plane was due to land in the northern Mauritanian port city of Nouadhibou, although it is not clear whether that was its final destination.
A hijacked Air Mauritania Boeing 737 passenger plane has landed on Spain's Canary Islands after making a fuel stop in Western Sahara, officials in Mauritania said today. It was hijacked after the takeoff from the Nouakchott airport.

While on the plane, the man demanded it to be flown to France to seek asylum.

The 71 passengers and eight person crew were let out when the hijacker landed the plane in Las Palmas. Several people were wounded by a gun and the suspect was arrested.

Reports say that it is unconfirmed as to what the man's motive was. Mauritanian police are still investigating.