Gen Sarath Fonseka was dragged away by military police
The defeated candidate in Sri Lanka's presidential election, General Sarath Fonseka, has been arrested at his office in Colombo.
Gen Fonseka was defeated by incumbent Mahinda Rajapaksa last month by six million votes to four million.
Gen Fonseka rejected the results and vowed to challenge them in court.
The initial allegations brought by the government against Gen Fonseka, 59, were put simply as "committing military offences".
The government had earlier been seeking legal advice on bringing a court martial on charges of plotting to overthrow the administration.
The BBC's Charles Haviland in Colombo says he later learned from National Security Director-General Laxman Hulugalle that the charges against the general relate to the alleged violation of rules preventing the discussion of political matters while being a member of the military.
Mr Hulugalle said the general would be questioned and put on trial in a military court.
Military law still covered Gen Fonseka despite his retirement, he said.
Gen Fonseka was in charge of Sri Lanka's army when it defeated the Tamil Tiger rebels last year after a destructive civil war lasting more than a quarter of a century.
However, he fell out with President Rajapaksa soon after and the pair fought a bitter election campaign.
Gen Fonseka's wife confirmed to the BBC that her husband had been detained after the security presence around his office in Colombo had been stepped up during the day.
Gen Fonseka's secretary, Senaka de Silva, was also said to have been arrested.
Gen Fonseka was meeting a number of politicians who had supported his candidacy.
The Muslim Congress leader Rauff Hakeem told Reuters news agency: "He was dragged away in a very disgraceful manner in front of our own eyes."
Mr Hakeem said the action was "authoritarian and vindictive".
Mr Rajapaksa won the election by 57% to 40%
A spokesman for the People's Liberation Front told Agence France-Presse: "The general refused to be taken away. They grabbed him and virtually carried him away after threatening the others. There must have been over 100 soldiers."
The politicians at the meeting said the military police had given no reasons as they made the arrest.
Mr Hakeem said Gen Fonseka had complained that because he was no longer in the military he should not have been arrested by military police.
Earlier in the day, Gen Fonseka had said he was prepared to give evidence in international courts on any war crimes charges brought in relation to the civil war.
"I am definitely going to reveal what I know, what I was told and what I heard. Anyone who has committed war crimes should definitely be brought into the courts," Gen Fonseka said.
Our correspondent, Charles Haviland, says the arrest was dramatic but not unexpected and there must now be questions about whether this is the start of a bigger clampdown on the opposition.
After the election, the government had accused Gen Fonseka of divulging sensitive information to the public, and of plotting both a coup and to assassinate the president and his family.
Gen Fonseka has vehemently denied the charges.
He said he feared an assassination attempt against him and had been told that airports would not allow him to leave the country.
Analysts had predicted a closely fought election contest between the two architects of the government's victory over the Tamil Tigers.
But in the end President Rajapaksa won the vote comfortably - capturing 57% of the vote, while Sarath Fonseka won 40%.