Tripoli airport clashes
A damaged aircraft is pictured after a shelling at Tripoli International AirportReuters

Libya's main airport in the capital Tripoli has been brought to a standstill after air controllers went on strike over clashes at the airport.

Flights across much of the oil-rich country were grounded after air control staff walked out to protest the shelling of the airport, a government official said on Thursday, as cited by Reuters news agency.

The strike comes after four days of intense fighting between rival militias seeking control of the country's biggest airport.

The violence is the worst in the Libyan capital for months and has left at least 20 aircraft damaged.

While Tripoli airport had already been closed, the staff on strike are also responsible for Misrata air control, meaning that Misrata airport would have to be closed as well, a transport ministry spokesman said.

Violence erupted at the airport on Sunday after militias from nearby Misrata attacked Zintan militants, who had been in de-facto control of the airport.

Libya's central government has failed to rein in militias in the wake of Muammar Qaddafi's ouster in 2011.

Heavily armed rival groups have established pockets of power across the country in a bid to establish economic and political power.

With flights grounded, thousands of Libyans and foreigners have been stranded in the capital during the Muslim holy month of Ramadan.