Guatemala's former military leader Efrain Rios Montt, who briefly ruled the country in the 1980s, has died at the age of 91.

In 2013, he became the first former head of state to face genocide charges in his own country.

Gen Rios Montt was accused of ordering the killing of more than 1,700 ethnic Mayans during a civil war.

The last several years of his life were spent fighting a legal battle against the allegations in court.

Gen Rios Montt seized power during a 1982 coup d'etat, in the midst of a bloody civil war in the country between the military regime and Marxist rebels.

His 17 months in office were considered some of the most ruthless of the war, with entire towns of indigenous Mayans - who were accused of harbouring insurgents - wiped out.

Gen Rios Montt was ousted as leader by his own defence minister in August 1983, who declared an amnesty for guerrillas.

He avoided prosecution by entering the country's Congress, which offered parliamentary immunity.

He would later return to the political limelight in 2003 and 2006, when he unsuccessfully ran for president despite a constitutional rule that no-one who had overthrown a government could stand for the office.

After his congressional immunity ended with his congressional title, he was eventually brought to trial.

National prosecutors said that during his 17 months in power the former leader and his chief of military intelligence ordered the deaths of more than 1,700 people from the Ixil Maya ethnic group.

He was found guilty of charges of genocide and crimes against humanity in a national court in 2013.

A judge sentenced him to 80 years, but that ruling was later thrown out by the country's high court.

Legal battles over whether he was fit to stand for retrial endured throughout 2015.

His trial eventually resumed in October last year behind closed doors and in special conditions because of his deteriorating mental health.

Gen Rios Montt's lawyer told the AP news agency he died on Sunday morning of a heart attack.