– Al-Shabab overran an African Union base in southern Somalia early Tuesday, a Somali military official said, in the latest display of the Islamic extremists’ capacity to hit back amid a prolonged offensive against them.

The attack in the small farming town of Janale started with a suicide car bombing at the base’s gate, followed by a firefight which lasted more than an hour, said Col. Ahmed Hassan.

The African Union force in Somalia, known by its acronym as AMISOM, insisted on Twitter soon after the attack that it was still in control of the base but later issued a statement saying the troops “undertook a tactical withdrawal” and then returned to the base.

“Given the complex nature of the attack, AMISOM is currently verifying the number of casualties and extent of the damage,” the statement said.

Al-Shabab said it killed about 50 African Union troops from Uganda at the base.

Hassan said that the militants overran the base after bombing a bridge to prevent troops from escaping. The bridge is a landmark that travelers often use to shuttle through south and central Somalia.

A Ugandan contingent of the African Union forces was targeted in retaliation over alleged killings by Ugandan troops of six men at a wedding in the nearby Somali port town of Merka in July, Al-Shabab spokesman Abdiaziz Abu Musab said on the group’s online Andalus radio.

“Very few escaped,” Abu Musab said, referring to Ugandan troops. “Others swam into the river and drowned. Others might have escaped into the jungle.”

Human Rights Watch last month urged an investigation into the wedding killings and called on the Ugandan government to prosecute any of its soldiers responsible for crimes. Citing witnesses, the rights group reported that after a bomb attack on an AMISOM convoy, Ugandan forces entered several houses in Merka. At one house, where a family was celebrating a wedding, the soldiers separated the men from the women and shot six adult men, according to Human Rights Watch.

Janale, a farming town 40 miles southwest of the capital Mogadishu, is under the control of AMISOM and government troops, but the foliage makes it easier for militants to access the town undetected.

Despite losing control over most of Mogadishu and other key strongholds in south and central Somalia in recent years, Al-Shabab still carries out attacks in Somalia and has targeted countries like Uganda and Kenya, which have sent troops to fight the extremists.