MOGADISHU, Oct 5 (Reuters) - Somali al Shabaab militants said on Saturday British and Turkish special forces had raided a coastal town overnight, killing a rebel fighter, but that a British officer had also been killed and others wounded.

A British Defence Ministry spokeswoman said: "We are not aware of any British involvement in this at all." A Turkish Foreign Ministry official denied any Turkish part in such an action.

A Somali intelligence official said the target of the raid on Shabaab's stronghold in the small southern coastal town of Barawe was a Chechen commander, who had been wounded and his guard killed. A total of seven people were killed, said police.

It was not clear whether the assault was related to the attack on a Kenyan mall two weeks ago, which the al Qaeda-linked group said it carried out and which killed at least 67. Nor was there any independent confirmation of what forces were involved.

Both U.S. and French forces have carried out similar raids in the past. The French army denied involvement and the Pentagon declined to comment.

Shabaab leader Ahmed Godane, also known as Mukhtar Abu al-Zubayr, has described the mall attack as retaliation for Kenya's incursion in October 2011 into southern Somalia to crush the insurgents. It has raised concern in the West over the operations of Shabaab in the region.

Sheikh Abdiasis Abu Musab, spokesman for al Shabaab's military operations, told Reuters foreign forces had landed on the beach at Barawe, about 180 km (110 miles) south of Mogadishu, and launched an assault at dawn that drew gunfire from rebel fighters in one of the militia's coastal bases.

He later said the attack was carried out by Britain's SAS unit and Turkish special forces, and that the British commander was killed during the raid and four other SAS soldiers were critically wounded. A Turkish soldier was also wounded, he added.

Western navies patrol the sea off Somalia, mired in conflict for more than two decades, and have in the past launched strikes on land from warships. Neither Turkish nor British forces have any past record of raids in the area.

Barawe is fully controlled by the Islamist militia with almost no government presence.

CHECHEN

Somali security officials gave conflicting accounts.

"We understand that French troops injured Abu Diyad also known as Abu Ciyad, an al Shabaab leader from Chechnya. They killed his main guard who was also a foreigner. The main target was the Shabaab leader from Chechnya," an intelligence officer based in Mogadishu, who gave his name as Mohamed, told Reuters.

A second Somali intelligence officer said the Barawe attack had been carried out by foreign forces. He confirmed the target was a foreign national, and said another foreigner was wounded.

Col. Abdikadir Mohamed, a senior police officer in Mogadishu, said that despite the statements by al Shabaab on the identities of the foreign forces, he still believed the attacking troops were American and their target was a senior foreign al Shabaab official.

"At least seven people died in the Barawe port town attack - five militants plus two of the attackers," Mohamed told Reuters.

In 2009, helicopter-borne U.S. special forces killed senior al Qaeda militant Saleh Ali Saleh Nabhan in a raid in southern Somalia. Nabhan was suspected of building the bomb that killed 15 people at an Israeli-owned hotel on the Kenyan coast in 2002.

NATO denied involvement in the Barawe attack, as did EU Navfor, Europe's counterpiracy mission off the Somalian coast.

"Westerners in boats attacked our base at Barawe beach and one was martyred from our side," Musab said.

"No planes or helicopters took part in the fight. The attackers left weapons, medicine and stains of blood, we chased them," he added.

"Although we both exchanged grenades, the attackers had silencer guns, so the weapons heard were ours."

HEAVY GUNFIRE

Residents said fighting erupted at about 3 a.m. (midnight GMT).

"We were awoken by heavy gunfire last night, we thought an al Shabaab base at the beach was captured," Sumira Nur, a mother of four, told Reuters from Barawe on Saturday.

"We also heard sounds of shells but we do not know where they landed. We don't have any other information."

The United States has used drones to kill fighters in Somalia in the past. In January 2012, members of the elite U.S. Navy SEALs rescued two aid workers after they killed their nine kidnappers.

In January this year the French military used helicopters to attack an al Shabaab base in a southern village to rescue a French hostage. Two French commandos were killed and the insurgents later claimed they had killed the hostage.

Al Shabaab were driven out of Mogadishu in late 2011 and are struggling to hold on to territory elsewhere in the face of attacks by Kenyan, Ethiopian and African Union forces trying to prevent Islamist militancy spreading from Somalia.

Al Shabaab wants to impose its strict version of sharia, or Islamic law, across the Horn of Africa state.

The Kenyan mall raid, in which attackers stormed in spraying people with bullets and throwing grenades, confirmed fears in the region and the West that Somalia remains a training ground for militant Islam.

A Kenyan military spokesman on Saturday named four of the attackers, saying they also included a Sudanese, Kenyan Arab and a Somali, trained by al Shabaab and al Qaeda.