(CNN) -- Thailand's Constitutional Court dismissed a case that could have disbanded the country's ruling party Monday, the country's MCOT news agency reported.
Judges ruled 4-2 that the case against the Democrat Party had been improperly filed, MCOT said.
The case alleged that the party had misused 29 million baht (about $958,000) in campaign funding provided by the government's election commission before an April 2005 vote, according to the news agency.
If the party had been found guilty, it could have been forced to disband, with its leaders -- including Prime Minister Abhisit Vejjajiva -- barred from politics for five years.
Earlier this year, Thailand's election commission -- an independent government body that oversees races and can disqualify candidates -- recommended the dissolution of Abhisit's party over a different campaign funding issue.
The commission accused the Democrat Party of accepting an $8 million campaign donation from a private company.
The Democrats came to power in 2008 after a similar chain of events.
In 2008, the court ruled that former Thai Prime Minister Samak Sundaravej violated the country's constitution when he appeared on a television cooking show for payment.
In the show, "Tasting While Grumbling," Samak served up his favorite Thai dishes, as well as commentary that struck his fancy. He was forced to step down as prime minister after the court's ruling.
Also that year, the court cited electoral fraud when it dissolved the then-ruling People Power Party.