Parliament named opposition party leader Abhisit Vejjajiva as Thailand's new prime minister today as supporters of the former government attempted to block the building following the vote.
Oxford-educated Mr Abhisit, who heads the Democrat Party, beat a loyalist of exiled former prime minister Thaksin Shinawatra, in a tense 235-198 vote in the lower house of parliament.
The vote comes after months of demonstrations that culminated late November with a week-long takeover of Bangkok's two airports.
Mr Abhisit told reporters yesterday that it was his party's "responsibility to offer another choice for the country when the former government has failed". He said his party would focus on national harmony and economic issues.
But protests erupted again as hundreds of pro-Thaksin supporters attempted to block the Parliament building.
After a fiery speech, a protest leader called on demonstrators to block the gates of the building and not let the MPs out. Police locked the doors from inside the building.
The anti-Thaksin protest movement seeks to purge politics of the influence of former Manchester City FC owner Mr Thaksin - who was ousted by a 2006 coup after being accused of corruption and abuse of power - and had threatened new, but unspecified activities if parliament elected a leader with links to him.
Mr Thaksin now lives in exile, having fled Thailand before an October conviction on a conflict of interest charge. But he continues to play an active role in politics, and on Saturday gave a pre-recorded video speech to a rally of more than 40,000 of his supporters who gathered at a stadium in central Bangkok.
Mr Thaksin decried inappropriate interference in the political process - a reference to the army's alleged intervention in favour of the Democrats - and denounced MPs who had been loyal to him, but switched their allegiances. The army traditionally wields a great deal of influence in Thai politics.
Mr Thaksin, a former telecommunications magnate, is still supported by many in Thailand's impoverished countryside because of his populist policies during his six years in power.
The demonstrators surrounded vehicles and hurled abuse at MPs inside but most dispersed peacefully, saying that they would gather again later in the capital's old historic section.
Riot police later cleared a path for MPs to leave the compound.
Following the vote, Mr Abhisit - at 44, one of the world's youngest heads of state - thanked fellow MPs and the public but said he would not talk about politics until he was officially endorsed as prime minister by the constitutional monarch, King Bhumibol Adulyadej.
The chamber normally has 480 members, but because of vacancies currently numbers 437. One MP died on the eve of the voting.
Despite today's protest outside parliament, analysts foresee relative stability in coming months following political chaos and the airport siege which ended after a court ruling on December 2 dissolved the ruling People's Power Party and two coalition partners.
It also handed a five-year political ban to former premier Somchai Wongsawat, who is Mr Thaksin's brother-in-law.