The fourteen men, termed as deserters by the government agencies were arrested from General Fonseka's election office on Jan 29, on charges of conspiring a military coup after Fonseka's defeat in the presidential election.
They were placed under detention before being produced in the court by the Criminal Investigation Department (CID).
The order was announced by the Chief magistrate Champa Janaki Rajaratne after the CID reportedly conceded before the court that it had no evidence to justify the further detention of the men, while adding that they had no objection to their release.
Police said that they can be released since their statement have been recorded.
Those released were ordered by the magistrate to appear before the court if a notice was issued.
It has been said the other detainees too have approach the court for their release.
Fonseka was accused of plotting coup by the government, which could result in him being court martialed. However, the charges are yet to be established.