Gunmen killed two people and wounded a third in an attack at the South Korean embassy in the Libyan capital Tripoli on Sunday which was claimed by the Islamic State group.
The gunmen opened fire on the embassy compound from a passing car, killing two people and wounding a third, a Libyan interior ministry spokesman told AFP.
A security source at the location said the two dead were both Libyan guards, adding that while the embassy had been closed for several months, South Korean officials were continuing to use it.
But Mabruk Abu Zaheir, another official at the interior ministry, told the LANA news agency that one guard and a civilian at the scene were killed and a second guard seriously wounded.
The foreign ministry in Seoul confirmed the attack, saying three South Koreans working in the embassy -- including two diplomats -- were unhurt.
It also said two Libyan guards were among the dead.
"We do not know whether the attack targeted the embassy or the Libyan (security) officers," a ministry official told AFP on condition of anonymity, adding that it was considering evacuating all its staffers from the country.
An AFP photographer at the scene of the attack said a vehicle used by the security guards was riddled with bullet holes, while it appeared that the main embassy building had not been hit.
IS claimed responsiblity for the attack on Twitter, according to SITE Intelligence Group.
"The Soldiers of the Caliphate in the city of Tripoli killed two of the guards at the South Korean embassy," the monitoring group quoted IS as saying on Twitter.
The jihadist group, notorious for its brutal rule of large areas of Iraq and Syria, has established branches in all three of Libya's historic regions.
It has claimed responsibility for several high-profile attacks on foreign targets in Libya, including an assault in January on the Corinthia Hotel in Tripoli and the beheading of Egyptian Coptic Christians.
IS has also targeted embassies in Tripoli and oil fields to kidnap foreign workers.
Last month four Filipinos, an Austrian and four other foreigners were abducted in an attack on the Al-Ghani oil field by IS militants killing eight guards, the Libyan unit tasked with protecting oil installations said at the time.
In February IS released a video showing the beheading of 21 Coptic Christians, mostly Egyptians, that the jihadists said they captured in Libya in January.
IS also claimed the attack on Tripoli's luxury Corinthia Hotel, which is known for hosting foreign diplomats and Libyan officials, that killed nine people including an American, a French national, a South Korean and two Filipinos.
Libya has been plagued by chaos since the end of the 2011 revolt that toppled Moamer Kadhafi, with heavily armed militias battling for control of its cities and oil wealth and rival governments and parliaments vying for power.
The country has had two governments and parliaments since Tripoli was seized in August by the Islamist-backed Fajr Libya militia and the internationally recognised government fled to the country's far east.