The Sorrento was travelling to the coastal city of Valencia when the blaze began and quickly got out of control.
The passengers were evacuated from the burning ship on to lifeboats and have been rescued by another ship.
At least three people have been injured and have been taken to hospital by helicopter, Spanish media say. One is reported to be seriously hurt.
The ship was about 27km (17 miles) from Mallorca when the fire broke out on Tuesday afternoon on one of the car decks. The reason for the fire was unclear.
Several ships including two passenger ferries were sent to help. The passengers and crew on the life rafts eventually boarded one of the ferries, the Puglia.
Spanish officials said the rescued passengers were on their way back to Palma de Mallorca and were expected to arrive at the port in a few hours' time. Psychologists were being asked to go to the port to provide counselling.
"Due to the fire that it has suffered, The Sorrento may sink in the position in which it finds itself," the Balearic Islands port authority said in a tweet (in Spanish).
The ferry, owned by Italian company Atlantica di Navigazione, sent out distress signals at 13:50 local time (11:50 GMT), said Spain's Ministry of Public Works.
At first, the ministry said the captain did not believe it would be necessary to abandon the ship but the fire became so intense that a full evacuation was called for.

3 May 2017 Last updated at 11:09 BST
It's part of a mega bridge called the Hong Kong-Zhuhai-Macao Bridge, which will connect three different places on the coast.
They used the world's heaviest crane ship to hoist the 6,000-tonne piece of concrete into place.
Jenny has all the details.

Security assistance has been withheld since 2011, when the Gulf state put down mass Shia-led protests.
But US State Department spokesman John Kirby said that Bahrain had made progress on human rights, including the release of political prisoners.
Bahrain is home to the US Navy's Fifth fleet and has flown airstrike missions over Syria as part of the US-led coalition against Islamic State (IS).
"We believe it is important to recognise that the government of Bahrain has made some meaningful progress on human rights reforms and reconciliation," State Department spokesman John Kirby said in a statement.
He added that this did not mean that the US thought the human rights situation in Bahrain was adequate.
"Following the lift of these holds, we will continue to press Bahrain on our human rights concerns," Mr Kirby said.
He gave no details about what the security assistance would entail.
The move was quickly criticised by rights groups. Sarah Margon, the Washington director of Human Rights Watch, said that the decision to lift restrictions was taking place without any "real or meaningful political reform" in Bahrain.
She said in a statement that "Bahrain's jails are bursting at the seams with political detainees and the recent prison sentence for political opposition leader, al-Wefaq secretary general Sheikh Ali Salman, means that a political accommodation remains as far away as ever."
Earlier in June, Sheikh Salman was jailed for four years for inciting hatred, promoting disobedience and "insulting" public institutions.
Shia-dominated demonstrations against Bahrain's Sunni monarchy have occurred sporadically since 2011.
Dozens died when the government moved to quash protests four years ago.
A fire has broken out on a Spanish ferry from Mallorca, forcing some 150 passengers and crew to abandon ship.
[NEXT_CONCEPT]
Engineers have been doing the tricky job of slotting in the last section of a huge undersea tunnel in south-east Asia.
[NEXT_CONCEPT]
The US has said that it will resume aid to the military in Bahrain.