U.S. Ambassador to Libya J. Christopher Stevens spoke to local journalists on April 11, 2011, at the Tibesty Hotel in Benghazi, where an African Union delegation was meeting with opposition leaders. (Ben Curtis/AP)

J. Christopher Stevens, the American ambassador killed Tuesday in an attack in Benghazi, Libya, hitched a ride into that country last year by sea — the only way in with a civil war in progress.

“There weren’t any flights, so we came in by a Greek cargo ship,” Mr. Stevens told reporters not long afterward, recalling his arrival in Benghazi as the top U.S. envoy to Libya’s rebel movement.

When he and his American colleagues reached the rebel-held city, they were greeted by a group of Libyans carrying U.S., British, French and Qatari flags in the courthouse square. Mr. Stevens said he and the other Americans found that they had no place to sleep, so they bunked that first night back on the ship.

The improbable journey was fitting for Mr. Stevens, a former Peace Corps volunteer who was fluent in Arabic and who had traveled throughout the Middle East. An easygoing but determined career diplomat, he had made the region the focus of his two-decade career.

Describing the episode during a visit to Washington, he played down the dangers inherent in opening a U.S. diplomatic mission in Benghazi. Instead, he focused on explaining his mission there: to support a democratic transition in Libya, which had been ruled by Moammar Gaddafi for four decades.

“It’s especially tragic that Chris Stevens died in Benghazi, because it is a city that he helped to save,” President Obama, standing alongside Secretary of State Hillary Rodham Clinton, said in a brief tribute Wednesday at the White House. “He worked tirelessly to support this young democracy.”

The attack on the U.S. Consulate building also killed diplomat Sean Smith, 34, an Air Force veteran who had served in various U.S. missions over the past decade, as well as two other diplomats whose identities have not been released, pending notification of their families. Mr. Stevens, 52, was the first sitting U.S. ambassador to be killed in a violent attack since 1979.

Officials said the ambassador, who was stationed at the embassy in Tripoli, was visiting the consulate at the time of the attack. The apparent cause of his death was smoke inhalation, according to several U.S. officials briefed on the attack, although the State Department has not confirmed that.

‘Courage and talent’

Funny and charming, with a broad smile and wide curiosity, Mr. Stevens made friends easily and kept them, colleagues said. He was well-known for haggling at the shops of the Old City in Jerusalem and lingering over coffee in the walled Old City in Tripoli.

“We were on opposite sides in a way,” said Ghaith al-Omari, a former top adviser to the Palestinian Authority who first dealt with Mr. Stevens during peace negotiations.

“During a meeting, he was very proper and professional. Having a coffee after the meeting, he was very friendly” and asked a lot of questions, Omari said. “You ended up with a diplomat who had texture.”

Deputy Secretary of State William J. Burns said Wednesday that he had followed Mr. Stevens’s career and believed him to be one of “the very finest officers of his generation in the Foreign Service.”

“I last saw Chris on a visit to Libya about six weeks ago, shortly after his arrival as ambassador, and I remember thinking on the plane ride home that his was the kind of courage and talent and leadership that would inspire another generation of American diplomats,” Burns said. “We will miss him deeply but long remember his example.”

Mr. Stevens had served in Israel, Egypt, Syria and Saudi Arabia, but Libya became the center of his career. He served there three times, beginning in the years before Gaddafi fell, when the mercurial leader was trying to repair decades of poor relations with Washington. Mr. Stevens was the No. 2 U.S. diplomat in Libya from 2007 to 2009.

When the Arab Spring revolts spread to Libya, Mr. Stevens became the Obama administration’s envoy to the opposition there, meeting with representatives overseas and eventually setting up the American diplomatic outpost in Benghazi. He returned to what he proudly called a “democratic Libya” as ambassador this spring.

A former State Department colleague, Wayne White, said Mr. Stevens used his disarming charm to persuade others. He recalled that Mr. Stevens would arrive in his office with a “big smile” and then give him some work.

The work might not have always been welcome, “but it was better if it came from Chris. He was just such a genuinely intelligent, high-minded guy,” White said.

As a diplomat, Mr. Stevens had a direct style that is unusual among his peers. Preparing then-Secretary of State Condoleezza Rice for a meeting with Gaddafi in 2008, he alluded to Gaddafi’s crush on Rice.

“A self-styled intellectual and philosopher, he has been eagerly anticipating for several years the opportunity to share with you his views on global affairs,” Mr. Stevens wrote in a diplomatic cable published by WikiLeaks.

Rice later recalled Gaddafi’s interest in her as “creepy.”

‘He wasn’t afraid’

Mr. Stevens, who grew up near Oakland, Calif., went to the University of California at Berkeley. He never married and had no children. His brother Tom Stevens, an assistant U.S. attorney in San Francisco, said the family had worried at times about Mr. Stevens’s safety.

“He was good-natured about it. He wasn’t afraid in places other people might think were scary,” Tom Stevens said.

Speaking with a Washington Post reporter in June, Mr. Stevens acknowledged a rise in violence in Libya, especially among small Islamist groups.

“It’s a function of there being a lot of freedom and desire to express views and agendas,” he said. “When people cross the line, it’s also a function of a lack of a strong state and police to enforce the law.”

Austin Tichenor, a high school classmate who became a college roommate and lifelong friend, said Mr. Stevens was passionate about a career that was worlds away from his own.

“He understood so much about the Middle East,” said Tichenor, an actor and writer. “The only small solace is that he died the same way he lived,” in the thick of things.

Mr. Stevens had worked as an international trade lawyer and a Peace Corps volunteer in Morocco before joining the State Department.

Arash Babaoff, a friend of Mr. Stevens’s since the 1990s, described him as an intensely committed diplomat.

“It was his life,” Babaoff said. “He was just someone who really had his heart in this, and he really felt like he was making relationships and headway.”

Babaoff called the killing “a blow to idealism.”

Tara Bahrampour and Julie Tate contributed to this report.