In the 1970s, Gates worked for five years for the National Security Council. Along the way, he also earned a Ph.D. in Russian and Soviet history from Georgetown University in 1974.
Gates served as the acting head of the CIA in 1986 and 1987 when William Casey became ill with cancer. Gates was nominated to replace Casey, but he withdrew his name from consideration when questions were raised about his role in the Iran-contra affair. He was nominated again, and confirmed, in 1991.
http://www.usnews.com/articles/news/politics/2008/12/01/10-things-you-didnt-know-about-robert-gates.html
Let’s remember: Gates was head of the CIA during Bush I. As such, he was involved in the invasion of Panama, the funding of a genocidal regime in Guatemala, the support of Suharto’s brutal government in Indonesia, and the overthrow of Jean-Bertrand Aristide in Haiti.