TRIPOLI - A helicopter carrying 16 people was shot down and crashed into the sea near Libya’s capital Tuesday with at least nine passengers, including a senior militiaman, confirmed dead, a military official said.

The aircraft was hit by gunfire shortly before noon and went down near the Al-Maya area just west of Tripoli, said Colonel Mustafa Sharkasi, a spokesman for the air force of Libya’s Tripoli-based government.

“We have so far recovered nine bodies, including the body of Colonel Hussein Abu Diyya,” a senior officer in the powerful Fajr Libya militia that controls the capital, he said. “We think that all the passengers are dead,” said Sharkasi.

A Tripoli-based official earlier said the helicopter had been carrying 23 people. Sharkasi said the aircraft was “unarmed” and blamed armed groups allied to the internationally recognised government for carrying out this “criminal” act.

And he vowed that the Tripoli-based administration would retaliate. “We will respond at the appropriate time and place,” he said.

Sharkasi said the helicopter was on its way to Tripoli from an unspecified location when it was hit. It had on board three crew members and “employees, including bank employees who were carrying funds for state employees” in addition to Abu Diyya.

Libya descended into chaos after the October 2011 ouster and killing of longtime dictator Moamer Kadhafi.

Two governments are vying for power and armed groups are battling for control of its vast energy resources. The Libyan capital was overrun in August 2014 by the Fajr Libya militia alliance which included Islamists.

The militia later established a rival government and a parliament that forced the internationally recognised administration to flee to the country’s remote east.