A member of the British special forces took part in the military operation following the al-Shabaab attack on a hotel complex in the Kenyan capital, Nairobi, in which 14 people were killed, The Independent has learned.

The SAS soldier, who had previously served in Afghanistan and Iraq, was seen in the thick of the action, helping to rescue civilians trapped amid the firefight and explosions, and guiding Kenyan forces as they tried to flush out the Islamist fighters from the buildings.

The soldier is part of a British training team based in Kenya, and was at the scene mentoring Kenyan troops who had been deployed at the dusitD2 complex in the affluent Westlands area, where the al-Shabaab attackers had smashed through security barriers, throwing grenades and spraying automatic rifle fire.

The Independent is not publishing details about the soldier’s identity for security reasons. He was spotted at the scene where wearing a balaclava, camouflage body armour, a dark blue top and jeans, he helped carry out stretchers, studied plans and directed sorties with Kenyan colleagues.

The SAS man was armed with a Canadian-made C8 Diemarco assault rifle and a Glock pistol. There were reports that he may have been a member of US navy seals as he also had a “pirate” badge but this may have been picked up while on exercise with American forces.

The SAS soldier was the only western security force member spotted at the scene. Joshua Kwambai, who ran out of a restaurant in the complex when the shooting started, said: “This guy got there quick, I think he was one of the first ones there. He had a mask on, but it was obvious he was white.

“We could see him talking to the police and army and they listened to him, they were looking at pieces of paper, maybe plans of the building.”

The SAS soldier evacuates an injured woman from the scene (Reuters) (REUTERS)

Another witness, Lucy Njeri, added: “This man carried out one of the wounded, and then went back and did that again. There was a lot of confusion, lot of people running around, but he stood out because he was a foreigner. He was very brave.”

A British man and an American woman were among those killed in the attack, but they are yet to be identified.

Armed Kenyan police respond to Nairobi hotel attack

The UK high commissioner to Kenya, Nic Hailey, said in a video posted on Twitter that: “I’m very sad to confirm that we believe at least one British national has been killed in the attack. We are providing our support to his family and friends at this very difficult time.”

The Foreign Office in London said it was “in contact with the Kenyan authorities” and was “ready to assist as required”.

The attack started at around 3pm local time on Tuesday. On Wednesday morning the Kenyan president, Uhuru Kenyatta, announced the assault was over, adding that the “terrorists” had been “eliminated” and more than 700 civilians had been evacuated to safety.