UNITED NATIONS – John Christopher Stevens, the American ambassador to Libya killed trying to evacuate the U.S. consulate in Benghazi during an attack by Islamist protesters, was a firsthand witness to Libya’s painful transition to democracy who became one of its casualties. He was 52.

Known to friends and colleagues as Chris, the California native was an Arabic-speaking, 21-year veteran of the State Department who had postings in Damascus, Cairo and other Middle Eastern locales before his first stint in Libya from 2007 to 2009.

Stevens, the No. 2 diplomat in Tripoli when Moammar Gadhafiwas still in power, went to Benghazi in 2011 as the eyes and ears for policymakers trying to gauge how to respond to the rebellion and avert a massacre in that city by Gadhafi forces. He was promoted to ambassador after the dictator was killed by rebels, and led the U.S. post there at the height of the revolution.

“With characteristic skill, courage and resolve, he built partnerships with Libyan revolutionaries and helped them as they planned to build a new Libya,” President Barack Obama said Wednesday in the Rose Garden of the White House.

Ali Aujuali, Libya’s ambassador to the United States, remembers meeting Stevens six years ago in Tripoli and thinking that the talented diplomat was going places. They formed a friendship over tennis games and breakfasts.

Stevens “was very enthusiastic” about the relationship between Libya and the U.S., Aujali told reporters Wednesday in Washington. “He believed that the Americans should support the Libyan people to get their country back.”

Stevens’ death comes four months after he was sworn in and dispatched to the most challenging assignment of his career: navigating the aftermath of Gadhafi in a divided country with no constitution or rule of law. Tribal rivalries have pitted regional militias against one another, and weapons made their way across borders, falling into the hands of insurgents.

“I had the privilege of swearing in Chris for his post in Libya only a few months ago,” Secretary of State Hillary Clinton said in a statement. “He spoke eloquently about his passion for service, for diplomacy and for the Libyan people. ”

At a March 23 Senate hearing, Stevens spoke of the “tremendous goodwill for the United States in Libya now” and how “Libyans recognize the key role the United States played.”

That faith suffered a blow Tuesday when an anti-Muslim film sparked an attack by armed protesters on the consulate in Benghazi and the embassy in Cairo. A clip of the disputed film, “The Innocence of Islam,” aired on YouTube shows a fictional attack by Muslims on a Christian family followed by an account of the origins of Islam depicting Muhammad as a womanizer.

“It’s especially tragic that Chris Stevens died in Benghazi, because it is a city that he helped to save,” Obama said.

Indiana Sen. Dick Lugar, the top Republican on the Senate Foreign Relations Committee, told reporters Wednesday that Stevens had been in Benghazi “attempting to at least try to survey how things were going there” with security of the U.S. consulate.

“I feel Chris Stevens’ loss as a personal loss,” said Lugar. Stevens had worked on his staff for a year in 2006 on a State Department fellowship.

Ibrahim Dabbashi, the deputy Libyan ambassador to the United Nations, was visibly moved as

“His personality was very simple,” Dabbashi, who was among the first Libyan officials to defect to the Gadhafi regime, told reporters. “He used to have the friends among high officials and simple Libyan people.”

During his tenure in Tripoli, Stevens had time to observe Gadhafi, who ruled Libya for more than four decades and was the first of the autocrats to be killed in the Arab Spring uprisings.

Stevens wrote a cable prepared for the historic visit to Libya of then-Secretary of State Condoleezza Rice in 2008, where he described Gadhafi as a “notoriously mercurial” figure who avoids eye contact.

Born in a small town in Northern California, Stevens went to high school in Piedmont, near Oakland, according to a biography on the State Department’s website.

He earned an undergraduate degree at the University of California, Berkeley, in 1982 and then taught English as a Peace Corps volunteer in Morocco from 1983 to 1985.

He received a law degree from the University of California’s Hastings College of the Law in San Francisco in 1989 and served as an international trade lawyer before joining the Foreign Service in 1991. In 2010, he received a master’s degree in national security studies from the National War College in Washington.

The Peace Corps service was key, according to Clinton. That’s when, she said, Stevens “fell in love with the Middle East.”