TRIPOLI - Several armed men attacked the headquarters of Libya's National Oil Corporation (NOC) in the capital Tripoli on Monday, killing at least two oil staff, a security official said.In the first attack of its kind against the top managers of Libya's state oil industry, two of the gunmen were also killed and at least 10 NOC staff wounded, officials said.Security forces said they had regained control of the landmark glass-fronted building in the center of the city.The attack came less than a week after a fragile truce halted fierce clashes between rival armed groups in Tripoli, the latest eruption of violence in Libya, which has been in turmoil since a 2011 uprising.Armed groups regularly block oilfields to make demands but the NOC headquarters had so far been spared the violence engulfing the North African country.The NOC provides the income for Libya and, along with the Tripoli-based central bank, is only state institution still functioning well amid chaos.No group immediately claimed responsibility for Monday's attack. Militants loyal to Islamic State have previously carried out attacks in Tripoli and other Libyan towns and cities.Gunfire rang out in the morning as security forces allied to the Tripoli-based government arrived."The death toll so far is two killed from NOC staff and two attackers," said Ahmad Ben Salim, spokesman for the Special Deterrence Force (Rada), one of the most powerful factions in Tripoli.Security forces smashed windows so staff could escape and several people were hurt by shattered glass, witnesses said. NOC Chairman Mustafa Sanalla and his office manager were seen safely leaving the building.Libya has been divided between rival governments and military factions based in the east and west of the country since 2014, causing political deadlock and an economic crisis.However, the NOC has continued to function relatively normally across Libya, which relies on oil exports for most of its income.Oil production has been hit by attacks on oil facilities and blockades, though last year it partially recovered to around one million barrels per day (bpd).Islamist militants have sleeper cells in northern cities as well as mobile units in Libya's southern desert, according to Libyan and Western officials.In May, Islamic State claimed a deadly attack on the national election commission offices in Tripoli. The group also claimed an attack in 2015 on the Corinthia hotel, a landmark location in Tripoli.The NOC attack came a day after the United Nations had said the major armed factions had agreed to freeze their positions to extend the ceasefire.