Pakistan's parliament has elected Mir Zafarullah Khan Jamali of the pro-military Pakistan Muslim League party as the country's first civilian prime minister since a 1999 military coup.
Accepting the vote, Mr Jamali endorsed the legacy of President Mr Pervez Musharraf who seized power in a 1999 bloodless coup, stressing the general's achievements in foreign and economic policy in particular.
"On the external front, because of the policy of the last three years, Pakistan has become a frontline state, Pakistan has respect and dignity," Mr Jamali said.
Pakistan became a key ally in the US-led "war on terror" after the September 11th, 2001 attacks on the United States, and Mr Musharraf's government has won praise from Western donors for stabilising the economy.
"The economy has picked up, we are about to be out of the woods," Mr Jamali said in a confident acceptance speech. "Thanks to Musharraf who gave a road map and fulfilled his promise . . . the transfer of power is going on."
Mr Musharraf promised last night to hand over the running of the country to a new prime minister, but he will remain as president for a further five years with the power to dismiss parliament.
Mr Jamali, a prominent politician from the southwestern province of Baluchistan, won 172 votes defeating the candidates from an Islamist alliance and a liberal party of exiled former Prime Minister Benazir Bhutto.
He won the support of smaller parties and some defectors from the Peoples Party to secure a thin majority of the total 328 votes cast.