Maseru - Lesotho's king on Thursday named opposition leader Tom Thabane as prime minister after May polls saw the ruling party crash to defeat, the royal palace said.

The appointment, which came after outgoing premier Pakalitha Mosisili accepted defeat, marked the first time in Lesotho's history that regime change came through the ballot box.

“His Majesty King Letsie III has appointed Mr Motsoahae Tom Thabane as the prime minister of Lesotho as of today,” a statement said.

The 72-year-old Thabane, a former foreign minister, is to be sworn in on Friday in Maseru, the capital of this tiny nation enclaved in South Africa.

Mosisili's Democratic Congress party won the most seats in the May 26 legislative election, but fell short of the required majority to govern alone and subsequently failed to form a working coalition.

Thabane's All Basotho Convention, the first of the opposition parties, teamed up with the Lesotho Congress for Democracy (LCD) and the Basotho National Party to share power and oust the reviled Mosisili.

A Gallup poll in April ranked Mosisili among Africa's five most despised leaders, with only 39 percent approving of his job performance, placing him alongside the likes of Zimbabwe's Robert Mugabe.

Thabane broke away from the LCD to form the opposition All Basotho Convention in 2006 after yet another feud with Mosisili, who had also formed his own party since then.

Textile factories and diamond mines are the only major industries, but jobs are so scarce that many seek work in South Africa.

Three quarters of homes have no electricity, one third have no running water, and nearly 25 percent of adults are HIV-positive.

More than half of the nation's two million people live in poverty. Many still travel by horse or donkey. - Sapa-AFP