Aden (AFP) - Fighting for a key port city on Yemen's Red Sea coast has left at least 40 rebel and pro-government fighters dead, military officials said Tuesday.

Loyalist forces said Monday they had captured the port of Mokha, almost three weeks into an offensive to oust Shiite Huthi insurgents and their allies from Yemen's southwestern coast.

But they exchanged fire overnight with rebels still holed up in the port on Mokha's southwestern edge.

Clashes continued Tuesday on the southern and eastern outskirts of the city.

"Despite the significant human toll, the Huthis are still in the centre of Mokha," a military official told AFP.

Rebel snipers were reported to have slowed the loyalist advance.

At least 28 rebels and 12 pro-government fighters have been killed in fighting in the past 24 hours, military and medical sources said Tuesday.

That brought to nearly 200 the number of deaths on both sides since the offensive began.

Huthi forces had controlled Mokha since they overran the capital Sanaa in September 2014 and advanced on other regions aided by troops loyal to former president Ali Abdullah Saleh.

Forces supporting President Abedrabbo Mansour Hadi, backed by a Saudi-led coalition, launched a vast offensive on January 7 to retake the coastline overlooking the Bab al-Mandab strait.

The strait is a strategically vital maritime route connecting the Red Sea and the Indian Ocean.

Military sources said fighter jets and Apache attack helicopters from the coalition have been pounding the Iran-backed rebels and their allies.

But despite the coalition's superior firepower, rebels and their allies still control the capital Sanaa, much of the central and northern highlands, and most of the 450-kilometre (280-mile) Red Sea coast.

Government forces say they want to oust rebel forces from the entire coastline, including the town of Midi near the Saudi border.

A government official said the rebels had brought reinforcements to Mokha from neighbouring Ibb province, and that the fight for the town would take time.

The World Health Organization says more than 7,400 people have been killed since the coalition intervention began in March 2015.

But UN humanitarian coordinator Jamie McGoldrick said last week that as many as 10,000 civilians may have died.