Pakistan's former military ruler Pervez Musharraf returned home on Sunday after more than four years in exile, defying a Taliban death threat and vowing to "save" the country at the risk of his life.

"I have come back home today. Where are those who used to say I would never come back?" the former dictator, who plans to stand in a historic May 11 general election, told members of his political party at Karachi airport.

Hundreds of supporters had gathered at the airport, beating drums, dancing, waving green flags with pictures of Musharraf and Pakistan's founder Mohammad Ali Jinnah, and scattering rose petals.

"I don't get scared by anyone except Allah the Almighty... I have come back by putting my life in danger," Musharraf, who also faces a series of legal cases, told a gathering of his All Pakistan Muslim League.

"I have been ordered by my people to come back and save our Pakistan, even at the risk of my life. I want to tell all those who are making such threats that I have been blessed by Allah the Almighty."

The upcoming election will be the first democratic transition of power in the history of the nuclear-armed country dominated by periods of military rule.

Pakistan Sunday selected a caretaker prime minister, retired judge Mir Hazar Khan Khoso, to head an interim administration to guide the country through the election period.

Musharraf, 69, is not thought likely to win more than a couple of seats for his party in the polls and he remains a highly controversial figure.

He seized power in a bloodless coup as army chief in 1999 but left the country after resigning in 2008, when Asif Ali Zardari was elected president after the murder of his wife, former prime minister Benazir Bhutto.

As ruler Musharraf escaped three Al-Qaeda assassination attempts. He became a prominent target for Islamist extremists after making Pakistan a key US ally in the "war on terror" after the 9/11 attacks.

Musharraf was forced to scrap plans to hold a public rally at Jinnah's tomb in Karachi after the Taliban threatened to send a squad of suicide bombers to assassinate him.

Party supporters said Musharraf was not now expected to make an address at around 5:00 pm and would leave the airport shortly for an undisclosed destination.

His official Facebook and Twitter accounts provided an upbeat commentary on his return, complete with photographs.

An AFP reporter said supporters on the flight from Dubai shouted "Long live Musharraf", annoying some of the regular passengers.

Musharraf, who has been granted protective bail to lift the threat of immediate arrest on his return to Pakistan, told reporters before leaving Dubai that he was "not feeling nervous" but admitted some concern.

"I am feeling concerned about the unknown... there are a lot of unknown factors of terrorism and extremism, unknown factors of legal issue, unknown factors of how much I will be able to perform (in the elections)," he said.

One of the legal cases that has long ensnared him concerns the assassination of Benazir Bhutto in December 2007, three months after she returned to Pakistan from her own self-imposed exile.

The then-ruler is accused of failing to provide her with adequate security. Another case concerns the 2006 death of Akbar Bugti, a Baluch rebel leader in the southwest, and another relates to the 2007 sacking and arrest of judges.

Bhutto's son Bilawal Bhutto Zardari, who is chairman of the Pakistan People's Party, has accused Musharraf of his mother's murder.

In 2010 a UN report said Bhutto's death could have been prevented and accused Musharraf's government of failing to provide her with adequate protection.

Security was tight at the airport in Karachi, which is suffering record political and ethnic violence. Other parts of the country are also plagued by extremist attacks.

On Saturday, a suicide bomber killed 17 Pakistani soldiers by ramming a water tanker packed with explosives into a checkpoint in the tribal district of North Waziristan in the northwest.

Police at the airport said 1,000 well-wishers had turned out although an AFP reporter said the number appeared about half that.

Supporters chanted "Long Live Musharraf" and his catchphrase, "Pakistan First". Young boys wore "Pakistan First" T-shirts emblazoned with his picture.

Wasim Ansari, a television actor and Musharraf lookalike who stars in satirical shows mocking the ex-dictator, was among the crowd.

"Whatever popularity I have gained today is because of Musharraf. I regard him as my leader and would do anything for him," Ansari joked to AFP.