People watch on TV as the Thai constitutional court gives its verdict. Photograph: Sukree Sukplang/Reuters

Thailand's constitutional court has averted a looming political crisis after dismissing a highly controversial case that alleged MPs in the governing party were plotting to topple the monarchy by amending the constitution.

The case centred around an attempt by lawmakers from the ruling Pheu Thai party to establish a drafting committee to amend the constitution, which they claim is undemocratic because it was drawn up in the wake of the 2006 military coup that deposed Yingluck's billionaire brother Thaksin.

In a swift verdict, the court ruled that "there [were] not enough facts" to prove the amendment aimed to overthrow the monarchy. It also ruled that the 2007 charter could be amended section by section, but not entirely rewritten.

The controversial case was seen as the latest test of Yingluck's government, which came to power a year ago in a landslide election that many saw as a referendum on Thaksin's rule.

Political clashes have repeatedly shaken the country's stability, and the threat of violence on Friday was real. Pheu Thai MP and United Front for Democracy against Dictatorship (UDD) co-leader Korkaew Pikulthong warned the Bangkok Post that "civil war will take place" if the court ruled unfavourably and issued a rally cry to supporters. "Once you hear a whistle blow, pack your bags and bid farewell to your family."

Riot police were on hand at the court and the military was also prepared to step in if needed, the government had said. Judges were protected by both police and bodyguards in the run-up to Friday's verdict as the court has removed two Thaksin-allied prime ministers in the past four years, as well as dissolved major political parties and banned top politicians from politics, moves that have sparked anger over the court's considerable political power.

The verdict, which was read live on radio and TV, helped defuse fears of a return to past violence. In 2008, Thaksin's opponents seized the prime minister's offices for three months and Bangkok's two airports for a week. In 2010, Thaksin's supporters held street demonstrations that degenerated into violence and clashes with the military that left more than 90 people dead and almost 2,000 injured.

The court's decision was delivered amid news that Thailand's King Bhumibol Adulyadej, 84, was being treated for a minor brain bleed after experiencing spasms of his right hand and a slightly quickened pulse. The king, who has lived in hospital since 2009 for poorly health, has cancelled his plans to travel to central Thailand this weekend.