Media reports about the killing of the U.S. Ambassador to Libya in Benghazi mention it's the first death of a U.S. ambassador in the line of duty in more than two decades. The last U.S. ambassador to die in the line of duty was Arnold Raphel, the U.S. ambassador to Pakistan, who perished in a plane crash in 1988, along with the then president of Pakistan, Muhammad Zia-ul-Haq. As with much of politics in Pakistan, the event was surrounded by conspiracy theories. A variety of foreign powers were blamed. A 2008 Times of London article reported, however, that a U.S. investigation found that a "relatively common" mechanical problem known of the plane, a C-130 military transport aircraft, caused it to crash. It was a sensitive issue at the time because Pakistan was America's closest ally, helping America funnel weapons to the mujahedeen who were fighting Soviet invaders in Afghanistan.
The last ambassador, then, to be killed in the line of duty was Adolph Dubs, the U.S. ambassador in Afghanistan, in 1979. He was assigned the post in 1978, shortly after a Soviet-backed coup in the country (which preceded the invasion in late 1979). Dubs was definitely killed, being shot in an exchange of gunfire during an attempted kidnapping. He was the last U.S. ambassador in Afghanistan until 2002, after the U.S. toppled the Taliban regime that emerged after the civil war that followed the end of Soviet intervention in Afghanistan in 1992. His assassination is considered by the State Department as a "Significant Terrorist Incident." As for the murder of the U.S. ambassador to Libya, Christopher Stevens, after an assault on the consulate in Benghazi, the U.S. is investigating whether the assassination was a planned act of terrorism.