Guatemala's next president, retired general Otto Perez, was a small child when a CIA-backed coup overthrew reformist President Jacobo Arbenz in 1954.

The fallout has framed his military and political career.

The democratically elected Arbenz wanted to redistribute land to resolve inequalities, and the move angered United States business interests. With U.S. support, Arbenz was ousted in just nine days -- and replaced by three decades of almost uninterrupted army rule.

Military repression led to an armed rebellion, which was in full swing when Perez entered the military academy at age 16. Perez, who was elected president on Sunday, later joined Guatemala's special forces, the kaibils, whose infamously brutal training included eating dog entrails and biting the heads off live chickens.

But it was the graduating military academy class from the Escuela Politecnica in 1969 -- a tight knit group of rising stars known as class No. 73 -- that defined his years in uniform, according to declassified U.S. government documents.

This ... class, which originally consisted of 95 officers, is considered an anomaly within the armed forces because of the exceptional cohesiveness it has maintained throughout the years, said a U.S. department of defence cable dated May 1982. It said class members looked out for each other and gathered at informal events like picnics, dances and birthday parties.

Perez emerged as a leader, top of his academic class and a standard-bearer for the rest, recalls Mario Merida who was a year behind Perez at the Escuela Politecnica and later served as deputy intelligence director under his command.

That unity was threatening to General Efrain Rios Montt, Guatemala's most notorious dictator during the 1960-96 civil war, in which around a quarter million people were killed.

Rios Montt took power in a 1982 military junta and a United Nations-backed Truth Commission that later examined civil war atrocities concluded that he presided over an average 800 killings a month during his 17-month rule.

Apparently nervous that the talented officers would band together to overthrow him, Rios Montt accused Perez and two other officers on the presidential guard and staff of corruption and ordered their arrest, the document from May 1982 says. They were soon released but the point was made, and a fissure grew between Rios Montt and some in the officer corps.

Most of the soldiers in the presidential guard were sent as a punishment to the areas of combat in Quiche, Huehuetenango and San Marcos, Merida said. General Perez went with the rank of captain and left as a commander in Nebaj.

Perez served as head of Guatemala's military intelligence unit, known as D-2, and used his wide connections to quickly move up the ranks, according to a State Department document from 1995, the year he was promoted to general.

Even critics of Guatemala's military give some credit to Perez's group for seeking a way out of the war and the long cycle of violence.

There was a group within the military that felt ... that only by ultimately ceding power to the civilian leaders would the institution of the army not just survive but thrive, said Kate Doyle, a senior analyst at the Washington-based National Security Archive, a private group that investigates U.S. foreign policy and national security issues.

It was kind of advanced realpolitik thinking within the military, and Perez was very much a part of that, Doyle said.

The U.S. government often praised Perez and his faction as progressives inside an institution with a brutal reputation.

Colonel Perez and this group of officers bear close watching for several reasons, said another declassified cable from 1994, unearthed by the security archive.

They are progressives that grew up with blood stains on their hands, though we have no direct information to suggest that Colonel Perez himself was involved in activities of this nature. At the same time, it cannot be authoritatively said that this group of progressive officers are not still influenced by their past.

In general, their goals are democratic and they may be the best hope for the army at this time, it said.

Two years later, Perez was one of the key figures to sign the peace accords that ended the long civil war.

In 2001, Perez formed the conservative Patriot Party and became a prominent member of Congress, starting his long push for the presidency.

(Editing by Kieran Murray)