TRIPOLI (Reuters) - Unidentified gunmen fired shots at the South Korean embassy in the Libyan capital Tripoli on Sunday killing two local security guards, South Korean and Libyan officials said.

Militants claiming loyalty to Islamic State said they were behind the attack, according to a statement on social media. It was not possible to verify the authenticity of the claim.

The gunmen fired from a car at the embassy compound, killing two security officers who were Libyan government employees and wounding another, Tripoli security spokesman Essam Naas said.

A South Korean foreign ministry official in Seoul said the embassy was staffed by two foreign service officials and one administrative staff member. He said the government was considering relocating it, but did not elaborate.

Libyan militants professing loyalty to Islamic State have claimed several high-profile attacks on foreigners in Libya this year, including an assault on the Corinthia Hotel in Tripoli and the beheading of 21 Egyptian Christians.

They have also claimed several attacks on embassies in Tripoli from where most countries have pulled out diplomatic staff due to the security situation.

Libya since Muammar Gaddafi's fall in 2011 has been caught up in a conflict between two rival governments and armed forces who have attacked towns allied with their opponents.