He entered the Army as a young man in 1957 and rose in the ranks. His graduating class at the Escuela Politécnica included officers who would later be among the founding members and leaders of Guatemala's guerrilla insurgency, such as his friends Luis Augusto Turcios Lima and Luis Trejo Esquivel. He became a brigadier general in 1984 and a division general in 1987. In february 1987 he was appointed as Defense Minister of the first government elected under Guatemala's new Constitution from 1985. He continued the fight against dissident elements from both the marxist-inspired guerrillas and right-wing hardliners, including some within the army. He supported the Thesis of National Stability as an alternative to the Doctrine of National Security, seeking a new role for the army in a democratic society and political solutions to the country's long and bloody civil war. This in part paved the way for the peace negotiations between the government and the marxist insurgency, which began in 1987 and culminated with the signing of peace accords in 1996. During his term as Defense Minister, he played a pivotal role in upholding the elected government from at least two coup attempts led by civil and military right-wing hardliners, in May 1988 and May 1989. After finishing his term as Defense Minister, Gramajo entered the graduate program at Harvard University's John F. Kennedy School of Government, where he obtained a degree in public administration in 1991. That year he also served as commencement speaker at the US Army's School of the Americas at Fort Benning, Georgia. While in the United States, he was served in a combined suit under Alien Tort Claims Act by the Center for Constitutional Rights, representing eight Kanjobal Indians, who survived the destruction of their village in the early 1980s, and the American nun Dianna Ortiz, who had been abducted and tortured in Guatemala in 1989. They accused him of having command responsibility for the abuses that took place. In 1995 Gramajo was judged civilly liable and ordered to pay a total of $47.5 million in damages: $1 to 9 million each to each of the Guatemalans, and $5 million to Sister Dianna. for having command responsibility under the Torture Victim Protection Act. He did not contest the lawsuit or pay the damages. In 1995, the United States revoked his entry visa, barring him from the United States. He died on 12 March 2004 at his ranch at Santa Lucía Milpas Altas, Sacatepéquez department. He and his son were attacked by a swarm of africanized bees and died from their many stings.