Friend turned foe
Fonseka, 59, was accused of trying to secure a place in a political party following talks with an opposition MP between October and November last year, just before he quit as chief of defence staff.
Leaked intelligence reports said Fonseka had tried to stage a military coup, an allegation he has denied.
Fonseka had been a close ally of Rajapaksa, and was key in the military's decisive victory over the Liberation Tigers of Tamil Eelam (LTTE) in 2009 after more than two decades of civil war.
The pair were considered heros by the Sinhalese majority in Sri Lanka due to the victory.
However, Fonseka later fell out with Rajapaksa and unsuccessfully ran against him in the January presidential election after quitting the army.
Fonseka was arrested soon after the presidential election that Rajapaksa won handsomely.
Although Fonseka was in military custody during parliamentary elections in April, he won a seat in the legislature.
While Friday's ruling carried no prison term, Fonseka will remain in military custody.
Human rights groups and Fonseka's party had protested against the three-member tribunal which began five months ago.
A separate court martial is still hearing charges that he engaged in corrupt deals. He also faces civilian charges of employing army deserters, an offence that carries a 20-year jail term.