MOSCOW -- The Russian Foreign Ministry said Thursday that it evacuated its embassy in Libya after armed men stormed the complex the day before, apparently seeking revenge for the killing of a Libyan Air Force officer.
The Russian statement and news reports described a pitched battle between security officers and the gunmen after they broke into the embassy in Tripoli. The ambassador and other staff members hid in safe rooms.
And though it was clear how the attack ended -- Russian security personnel expelled the attackers, killing two of them, and then the entire embassy staff left the country -- why it started remained murky.
"According to the information we have, the direct reason for this aggressive action toward our diplomatic mission was the murder on Oct. 1 by a Russian citizen, Ekaterina Ustyuzhaninova, of a Libyan officer and the infliction of a knife wound on his mother," the Russian Foreign Ministry's statement said.
"The incident provoked relatives and friends of the murdered Libyan to avenge his death with an attack on the Russian diplomatic mission," it concluded.
Ms. Ustyuzhaninova's motives, her connection with the dead man and her reasons for being in Libya were not clarified. She was arrested by the Libyan authorities and will face charges in the killing.
One report on Libyan television described the killing as the handiwork of a "female Russian" assassin who might have also killed other military officers. None of those details could be confirmed.
A video reportedly from the murder scene that was posted on Facebook showed a body and "Death to rats" written in blood in English on a wall beside it.
After the attack on the embassy on Wednesday, Foreign Minister Mohamed Abdel Aziz of Libya told the Russian ambassador that the Libyan government would "not be in a position to guarantee the safety" of the diplomatic mission, the Russian statement said. Foreign Minister Sergey V. Lavrov later lodged a protest with his Libyan counterpart in a telephone call on Thursday.
By Thursday afternoon, the ambassador and all diplomatic personnel and members of their families had crossed the border with Tunisia and were expected to leave for Moscow on Friday on a flight organized by the Russian Ministry of Emergency Situations.
The Russian authorities have long been deeply critical of the Western-led military intervention that helped overthrow Col. Muammar el-Qaddafi, saying it led to instability.
Still, the Foreign Ministry's statement refrained from making any broader point about the episode, and even noted that Russian personnel received help from a pro-government militia during fighting at the embassy. Russian oil and weapons companies have been trying to restore business ties with Libya.
The incursion into the Russian Embassy occurred just over a year after Islamist militants overran the United States diplomatic mission in Benghazi, in eastern Libya, in an attack that left four Americans dead, including the ambassador, J. Christopher Stevens.
This article originally appeared in The New York Times.