General Sarath Fonseka, the defeated candidate in Sri Lanka's presidential election, has been arrested in Colombo on charges of plotting to overthrow the country's government, defence officials said.
In a statement, the defence ministry said Fonseka would be charged with "fraudulent acts and other military offences" from his time in the army, which ended in November when he quit to enter politics.
Keheliya Rambukwella, a defence ministry spokesman, said Fonseka had been "plotting against the president while in the military".
"When he was the army commander and chief of defence staff and member of the security council, he had direct contact with opposition political parties, which under the military law can amount to conspiracy," he said.
Al Jazeera's Minelle Fernandez, reporting from Colombo, said: "The director-general of Sri Lanka's Media Center for National Security, Lakshman Hulugalle, has confirmed the arrest of Fonseka by the military police.
"Hulugalle said Fonseka will face trial before a military court on charges of conspiring to overthrow the government, violating military laws and sowing dissension among members of Sri Lanka's armed forces."
However, Rajiva Wijesinha, the secretary of Sri Lanka's ministry of disaster management and human rights, said Fonseka was likely to face trial in a civilian court.
"The investigation has to be done by the military because a lot of this pertains to issues that regard national security," he said.
"[But] I believe that Mr Fonseka will be charged in a civilian court and the whole process will be open to scrutiny.
Rauff Hakeem, Sri Lanka's Muslim Congress leader, told the Reuters news agency that the former army chief "was dragged away in a very disgraceful manner in front of our own eyes".
Witnesses said that Senaka de Silva, Fonseka's campaign manager, was also detained.
Many credit Fonseka with winning the war against the separatist Liberation Tigers of Tamil Eelam (LTTE) in May, but he fell out with Rajapaksa soon after and the pair fought a bitter election campaign.
Fonseka was defeated by Rajapaksa last month by six million votes to four million.
Jehan Perera, an analyst with the National Peace Council activist group, said he believed that the arrest was a political move possibly aimed at preventing Fonseka challenging the election result in court or standing in upcoming parliamentary polls.
"We have to ask why now? Why not six months ago when he was a military officer," he said.
Fonseka has refused to accept his election defeat, saying his supporters were intimidated and the result fixed.
The former army chief has also accused the government of trying to frame him and alleges there is a plot to kill him.
Fonseka's wife Anoma said on Tuesday that her husband had been treated "like an animal".
"This is not an arrest. It is an abduction," she said. "What I want to tell the government is: 'Just be reasonable. Treat him like a human being.'"
Several senior military officials who were considered a "direct threat" to national security have been removed since his defeat in the election.
Asoka Bandarage, an expert on Sri Lankan politics and a professor at Georgetown University, told Al Jazeera that most people in the country simply wanted stability following the election.
"They want to move forward, so the emphasis should be on reconciliation instead of politicians fighting with each other and in that sense, it's very unfortunate," she said.
"It was an overwhelming victory and even the international community has asked the opposition to accept the verdict of the people.
"I think the attempt to challenge that has exacerbated problems and deepened the divisions of the society at a time when all groups need to come together."