A sign for the Benghazi International School, where Texas teacher Ronnie Smith had worked, in Libya. (Abdullah Doma/AFP/Getty Images)

An American teacher was shot and killed Thursday while jogging in the eastern Libyan city of Benghazi, where the U.S. ambassador and three other Americans were killed last year.

Ronnie Smith, 33, a Texan, taught chemistry at the International School Benghazi, school officials said.

“He was a much loved teacher who supported students in their learning and always had time to help when asked,” the school said in a posting on its Facebook page. “Ronnie was a professional who gave his time freely and without question. We do not understand why this has happened and it is extremely difficult for his students and his colleagues to accept.”

On what appeared to be Smith’s Twitter account, he described himself as “Libya’s best friend.” Smith was married and had a 2-year-old son, Adel al-Mansuri, an official at the school, told Agence France-Presse. Al-Mansuri also said that another American teacher at the school has been taken to a secure location until he can leave the country.

At the White House, spokesman Jay Carney offered condolences to the victim’s family and said President Obama had been briefed on the incident. He said no group had asserted responsibility for the attack. “We do expect the Libyan government to investigate,” he said.

U.S. Embassy officials in Tripoli said Libyan authorities “have been helpful and cooperative in dealing with this tragedy.”

Benghazi, one of the most violent flash points in an increasingly strife-torn country, gained notoriety last year when U.S. Ambassador J. Christopher Stevens and three other Americans were killed in an attack on a U.S. outpost there.

That attack prompted a congressional investigation, intense political fighting between the Obama administration and Republican lawmakers, and a review of security at U.S. diplomatic missions around the world.

U.S. officials consolidated all Libyan diplomatic operations into the well-fortified embassy compound in Tripoli and issued warnings urging Americans to avoid Benghazi, a port city about 300 miles to the east. U.S. diplomats said they no longer travel to Benghazi.

Smith was one of the few foreigners thought to be living and working in Benghazi, which has been the site of numerous bombings, assassinations of government security officials and other violence in recent months.

Embassy officials estimated that about 5,000 U.S. citizens, many of whom hold dual U.S.-Libyan citizenship, live in Libya. Foreigners have largely avoided Libya since the 2011 revolution, supported by the United States and other Western allies, that ousted longtime dictator Moammar Gaddafi.

The elected government that followed Gaddafi has been unable to establish reliable security in the country, and the national police force and military remain weak. Security has largely been left in the hands of hundreds of heavily armed militias.

Although many of the militia members nominally work for and with the government, they are widely seen as independent forces­ that do as they please. Many have been accused of violence and other criminal activity.

Fighting between militias and the government has spiked in recent weeks amid efforts by Prime Minister Ali Zeidan to persuade militia members in Benghazi to disarm. On Nov. 16, the U.S. Embassy issued a statement urging U.S. citizens to use “extreme caution” after several violent clashes in Tripoli.

Smith’s students took to Facebook and Twitter on Thursday to post remembrances of him. One student recalled that he baked peanut butter cookies on her birthday and sang “Happy Birthday” to her in Arabic. Others recalled watching the TV shows “Breaking Bad” and “Modern Family” with him.

Another recalled him telling students: “Everyone, I just want you all to know, you’re the future for this country.” The student added: “RIP, sir.”

On a Nov. 15 Twitter posting, Smith tweeted what appeared to be a wedding anniversary message. The tweet included a wedding photo and said, “16 years with my besty.”

Three days earlier, he tweeted that “the wife left today.” Several news reports said Smith’s family had gone home for the holidays and that he was expected to join them soon.

Smith’s Twitter postings are largely light-hearted banter with students and friends, and lots of musings on life in Libya. On Nov. 5, he tweeted a message clearly intended to be funny, but also suggested an awareness of the dangers of living in Libya: “I understand I teach at a school of rich kids, so if (and when) I’m kidnapped by Ansar Al-Sharia, who’s gonna pay the ransom?”

U.S. officials have identified Ansar al-Sharia as one of the extremist groups that had participated in the attack that killed Stevens. The group is among the most extreme and uncontrollable militias operating in Libya, and it is especially strong in Benghazi and other lawless areas in the eastern part of the North African country.

According to the International School Benghazi’s Web site, the school is privately owned and offers kindergarten through 12th-grade education in English, following a British curriculum. The Web site says the school is managed by GEMS Education, a private company that operates international schools.

Scott Wilson contributed to this report.