Suspected members of Somalia's al-Qaeda-affiliated al-Shabab fighters have attacked a fortified area housing regional government headquarters, an airport and a United Nations compound in the central town of Baidoa, security officials said.

"They are Shebab disguised in Somali military uniforms. That's how they managed to enter," a Somali police official in Baidoa, Mohamed Dahir, told AFP by telephone on Thursday.

Officials said around four gunmen shot and wounded or killed several people at the gate of the fortified area before entering it.

Two of the attackers are thought to have detonated bombs strapped onto them, a security official said.

A United Nations source confirmed that an attack was under way, but that the compound where aid agencies are located did not appear to be the target.

Baidoa, situated 220km northwest of the capital Mogadishu, was captured by Ethiopian forces in February 2012, ending three years of al-Shabab rule.

In November the city became the capital of Somalia's newly created South West State and the seat of its president Sharif Hassan Sheikh Adan, a former parliamentary speaker and ally of the country's internationally-backed government.

Al-Shabab has been fighting Somalia's UN-backed government since 2007, and is blamed for a spate of attacks in the war-torn country and in neighbouring Kenya.

The group, which continues to engage African Union peacekeepers despite being dislodged from Mogadishu, claimed responsibility for the September 2013 attack on a shopping mall in the Kenya, which killed 77 people.

Source: Agencies