(CNN) ISIS has claimed responsibility for a deadly assault on the Foreign Ministry of Libya's internationally recognized government in Tripoli on Tuesday, according to the terror group's media wing.

The building was stormed by three men armed with machine guns, a spokesperson for the United Nations-backed Government of National Accord told CNN. Three people who worked there were killed.

One victim was a high-ranking official, the spokesperson added. Eighteen others were injured, according to the Health Ministry.

The gunmen died in the attack that happened at around 9.30 a.m. local time. One gunman is believed to have been killed after an explosion was heard in the top floor of the building, politician Guma El-Gamaty who was in the area said.

"The top floor was totally engulfed in fire; you can still see smoke coming from the building," he said.

Read More