YEREVAN (Reuters) - An Armenian court of appeal ordered former president Robert Kocharyan detained on Friday on charges of attempting to overthrow the constitutional order, days before a parliamentary election in the ex-Soviet country, his spokesman said.

Slideshow ( 2 images )

Kocharyan served as Armenia’s second president from 1998 to 2008 when mass protests erupted against a disputed election result.

He was arrested in July this year but released the following month and his case sent to the court of appeal.

“This decision was restored as a result of pressure,” Kocharyan’s spokesman Viktor Soghomonyan told reporters. Kocharyan has dismissed the charges as politically motivated.

“It’s obvious that this verdict is, first of all, the result of a political decision and was rendered under conditions of tough pressure from the authorities,” Kocharyan said in a statement on Friday before being arrested for two months of preliminary detention.

An early election will be held on Sunday in a move to cement the outcome of a peaceful revolution when demonstrators led by opposition leader Nikol Pashinyan pushed the former ruling party out of power earlier this year.

Investigators have charged Kocharyan with an attempt to overthrow the constitutional order during events after the 2008 election when his ally Serzh Sarksyan became president.

In February-March 2008 the opposition held protest rallies, contesting the result of the election. The protests were dispersed and 10 people were killed in clashes with police. The Constitutional Court upheld the election result.

Pashinyan, an opposition activist at the time who was imprisoned in June 2009 on charges of fomenting unrest during post-election protests, was elected prime minister by parliament on May 8 this year.

He stepped down in October and became acting prime minister to allow parliament to be dissolved and an early election to be held and said he expected a new legislature to emerge that better reflected the country’s political realities.