BANGKOK — Friends and foes alike of former Thai Prime Minister Yingluck Shinawatra are anxiously awaiting a verdict Friday by the Supreme Court on charges she was criminally negligent in implementing a rice subsidy program that is estimated to have cost the government as much as $17 billion and could send her to prison for 10 years.

Supporters are expected to appear outside the courthouse to show their backing for Yingluck, but the military government has threatened legal action against anyone who helps transport them to the scene.

The verdict is generally seen as a political judgment as much as a criminal one. The case against Yingluck is the latest in a decade-long offensive against the political machine founded and directed by her brother, former Prime Minister Thaksin Shinawatra, who was ousted in a 2006 military coup for alleged corruption and disrespect for the monarchy.

Thaksin, a telecommunications mogul, has been in self-imposed exile since 2008 to escape a prison sentence on a conflict of interest conviction. The 2006 coup triggered years of sometimes-violent battles for power between his supporters, mainly the less well-off rural majority who delivered him thumping election victories, and his opponents, mainly royalists, members of the urban middle and upper classes, and the military, who in 2014 ousted Yingluck’s elected government as they had her brother’s.

Yingluck has appeared calm in the days leading up to the verdict, making merit at Buddhist temples and reportedly praying for a victory in Friday’s ruling.

However the Supreme Court rules, the junta is likely to lose face, one analyst said.

If the court rules not guilty, “the generals will have egg on their face,” said Paul Chambers, a political scientist at Naresuan University in northern Thailand, since the military’s reasoning for staging the 2014 coup was, in part, to rid the system of corrupt politicians.

If she is found guilty, “then the generals will have to deal with what comes next and that could be a martyr figure,” Chambers said.

The rice subsidy was a flagship policy that helped Yingluck’s party win the 2011 general election. The government paid farmers about 50 percent above what they would have received on the world market, with the intention of driving up prices by warehousing the grain.

Instead, other rice-producing countries captured the market by selling at competitive prices. Vietnam as a result replaced Thailand as the world’s leading rice exporter.

The military government said Wednesday it expects by next year to finally have sold off the stockpile of 17.8 million tons of rice the subsidy created. It has earned $40 million from the sales but calculates the government lost billions because it couldn’t export at a price commensurate with what it had paid farmers.

Yingluck already has been held responsible for about $1 billion of the losses in an administrative ruling that froze her bank accounts.

Prosecutors in the criminal negligence trial argued that Yingluck ignored warnings of corruption in the subsidy program.

“I think the designer of the program did not think carefully, did not understand the functioning of the rice market, particularly the world rice market,” said Niphon Poapongsakorn from the Thailand Development Research Institute, who gave evidence at the trial.

“What they thought (about) was only the beneficial impact of the program, which is not a surprise because I believe the hidden agenda of the policy was to win a landslide election.”

Yingluck was ousted as prime minister by a court ruling involving a nepotism case shortly before the coup ejected her government. Since then she has been formally impeached and banned from political office for five years.

The court cases and possible criminal conviction aside, Yingluck retains great popularity with her base.

Millions, like farmer Gaysorn Petcharat, saw their incomes suddenly rise markedly. There was money to buy luxuries and to invest in their farms.

Now Gaysorn’s income has dropped back sharply. But her loyalty to Yingluck is unwavering.

“If you ask any farmer if they like Yingluck, they all like Yingluck because she was willing to help us,” she said, pausing from harvesting her field in Chachoengsao province outside Bangkok.

“She did her best for us. All my life I’ve never sold rice at such a good price as when she was prime minister.”

Yingluck denies the negligence charges. She told the court she was the victim of a “political game” aimed at crushing the Shinawatra clan, first her brother Thaksin, and now her.

Some analysts agree, and believe the prosecution’s approach sets a dangerous precedent.

“I think it is clear enough that politics is involved in the Yingluck trial,” said Thitinan Pongsudhirak, director of the Institute of Security and International Studies at Bangkok’s Chulalongkorn University.

“I mean, this is a government that was elected in 2011 by a simple majority and it had a policy platform led by the rice pledging scheme. The scheme led to losses probably, but on the other hand, if we use this benchmark for other governments, then we could have a lot of government leaders in jail.”