The victory will give Prime Minister Abhisit Vejjajiva some political breathing room, easing pressure from within Parliament to hold a quick general election.

But the narrow margin of his victory highlighted an unstable relationship within his six-party ruling coalition that was stitched together in December 2008.

The opposition had accused the government of violating the human rights of thousands of anti-government protesters whose nine-week demonstration from mid-March descended into urban warfare and the worst political violence in modern Thai history.

The government also stood accused of corruption and economic mismanagement, while the foreign minister faced accusations of disloyalty to the monarch — a serious allegation in a country with some of the world's toughest lese-majeste laws. After two days of parliamentary grilling broadcast live on television, Abhisit won 246 votes with 186 against.

"Abhisit has emerged reasonably strong from the debate, at least among the powerful middle classes," said Sombat Thamrongthanyawong, head of the National Institute of Development Administration.

"Since he is the incumbent who has support of the coalition, he won't feel the need to go to the polls soon," he said.

But other Cabinet members won by narrower margins, in some cases winning barely half of the 475 parliamentary votes.

The vote threatens to widen a rift between two small coalition parties after a faction in one withheld support for some ministers from the other.  Abhisit said he had assigned his deputy to smooth over the rift and make sure it did not undermine stability.

Stock investors had expected Abhisit to win the vote and the benchmark SET index ended 1.18 percent higher after the central bank kept its policy interest rate unchanged. The opposition Puea Thai Party, the latest in a series of political parties led or backed by ousted former Prime Minister Thaksin Shinawatra, said the government was at fault for the weeks of violence in which nearly 1,800 were wounded.

Its speakers said excessive measures were used by troops in attempts to surround two protest sites before they finally dispersed the demonstrators on May 19.

Abhisit said shadowy militants among the peaceful demonstrators triggered the bloodshed to discredit his government.