Abhisit Vejjajiva won the vote by a relatively narrow margin
Thailand's opposition leader, Abhisit Vejjajiva, has been confirmed as the country's new prime minister after winning a special vote in parliament.
The speaker of the lower house, Chai Chidchob, said the Democrat Party leader had beaten ex-police chief Pracha Promnok by 235 votes to 198.
Mr Abhisit will become Thailand's fifth leader in a little over two years.
The previous Prime Minister, Somchai Wongsawat, was forced to resign after a court ruling earlier this month.
The constitutional court found his governing People Power Party (PPP) guilty of fraud during the last election a year ago, and banned it and two other parties in the governing coalition. Mr Somchai was also barred from politics.
The parties have now regrouped under new names, but the Democrat Party won over enough defectors and unaligned MPs to win support.
The BBC's Jonathan Head in Bangkok says Mr Abhisit will immediately be confronted by some formidable challenges - rebuilding economic confidence, healing deep political divisions, and making an unwieldy coalition government perform better than its recent predecessors.
The country was stricken by months of political deadlock as anti-government protesters mounted a campaign to topple the PPP.
The People's Alliance for Democracy (PAD) accused the party of being a proxy for Mr Thaksin, who was ousted in a coup in 2006.
The protest culminated in a week-long occupation of Bangkok's main international airport which left 300,000 foreign tourists stranded.
The PAD called off its action following the constitutional court ruling.