Somchai's election came more than a week after Thailand's constitutional court ordered Samak Sundaravej to stand down as prime minister over his hosting of a TV cooking show.
The anti-government People's Alliance for Democracy (PAD) – a pressure group of royalists, businessmen and union activists – had opposed Samak's leadership, accusing him of being a Thaksin puppet.
On August 28, thousands of PAD supporters stormed Government House in Bangkok to demand Samak's removal from office.
Since then however the group's goals have broadened to oppose both the nomination of Somchai or anyone else they see as associated with Thaksin, including the People's Power Party (PPP), which won national elections held last December.
Following Wednesday's vote, Somsak Kosaisuk, a protest leader, told PAD supporters camped out in the grounds of Government House that demonstrations would continue "until the remnants of Thaksin's regime are gone."
|PAD supporters say they will oppose anyone associated with Thaksin [Reuters]
PAD leaders say Thaksin, who recently fled into exile in the UK, bought his way to power, enriched himself at the country's expense, and is continuing to exercise influence over the government through his allies in the PPP.
Somchai was named as Thailand's caretaker prime minister last week, after Samak was forced to stand down.
But with the PAD firmly opposed to his leadership, his confirmation in the post is unlikely to bring an end to the weeks of political turmoil that has rocked Thailand and badly dented its economy.
On Tuesday rebel MPs in the PPP had threatened to reject Somchai's candidacy, saying the nomination of a Thaksin relative would only inflame and prolong anti-government protests.
But hours of intensive political bargaining meant most eventually toed the party-line in Wednesday's vote and backed the leadership's nomination.
In a separate development on Wednesday, Thailand's supreme court delayed its verdict in a corruption case against Thaksin and his wife and issued a new arrest warrant ordering them to appear before the court to hear its ruling.
In a statement the judges said they were delaying their verdict until October 21, saying the couple needed to be present in the courtroom for the reading.
"These defendants have to appear before the court. According to the legal process, the court has issued an arrest warrant to bring them back to listen to the verdict," chief judge Tonglor Chomngarm said.
Thaksin and Potjaman Shinawatra have denied any wrongdoing in a deal involving the sale of a plot of prime real estate in the Thai capital, Bangkok, from a government agency at what prosecutors say was well below its market value.
The sale was the subject of an investigation by anti-corruption officials appointed after Thaksin was ousted.