MOGADISHU - At least 30 pro-government fighters and dozens of al Shabaab militants were killed in Somalia in some of the bloodiest fighting of a year-long offensive against the al Qaeda-linked group, an army officer and clan elder said on Thursday.

The clashes on Wednesday in the Shabellow forest were the latest demonstration of the uphill task Somali troops and allied militiamen face in their effort to root out al Shabaab, which has been waging an insurgency since 2006.

A military campaign launched last year by the army and allied clan-based militias in central Somalia seized significant swathes of land from the militants early on but has registered mixed results of late.

Although government forces have captured several major towns, al Shabaab has been able to reclaim some of the territory it lost and conduct deadly raids on military bases.

Last month, Somalia's government asked the United Nations to pause a planned drawdown of 3,000 African Union peacekeepers because of what it called "several significant setbacks" on the battlefield.

The Somali forces initially drove back the al Shabaab fighters in the Shabellow forest on Wednesday but were then surprised by sniper fire, Major Ahmed Nur told Reuters.

"We killed al Shabaab like flies, but when we tried to take the weapons from their dead, hidden snipers took out our men," he said.

He said 30 government soldiers and allied militiamen were killed, while 55 al Shabaab fighters died. A local clan elder, Abdullahi Mohamed, said 33 pro-government fighters and "dozens" of al Shabaab were killed.

Nur added that 10 of his colleagues were injured on Thursday when a helicopter - believed to be operated by one of Somalia's foreign allies - mistakenly bombed them.

The current phase of the offensive against al Shabaab has focused on central Somalia. The government has promised a second phase that will go after the group in its strongholds in the country's south, where analysts say the group will be even harder to defeat.

(Reporting by Abdi Sheikh; Writing by Aaron Ross; Editing by Alexandra Hudson)