BANGKOK — A Thai court ruled Friday that a postponement of coming elections, which protesters have worked feverishly to block, is lawful under the country’s Constitution.

The decision by the Constitutional Court was a blow to Prime Minister Yingluck Shinawatra and surprised many legal scholars, who say there are no provisions under Thai law for a delay.

Some constitutional experts described the decision as a form of judicial coup d’état because it could leave a power vacuum if elections were not held.

The court’s decision heightens the complex and debilitating power struggle between Ms. Yingluck’s governing party, which is almost sure to win the elections if they proceed, and protesters who have spent the past two months on the streets of Bangkok vowing to stop them. The protesters’ goal is to purge from politics Ms. Yingluck and her brother Thaksin Shinawatra, a tycoon and former prime minister who left the country in 2008 to escape a two-year prison sentence for abuse of power.