A heavily-armed man seen working with Kenyan forces and helping victims during the Nairobi attack this week was a member of Britain's special forces, British media reported, citing officials.

"Without this British special forces soldier, many more lives would have been lost," the Daily Mirror quoted a senior British military source as saying.

"His selfless action will be remembered by those he rescued and privately celebrated and acknowledged by his colleagues," the military source said.

The paper said the man was part of a small "liaison" team embedded with Kenyan special forces.

Former special forces soldier Chris Ryan was quoted in the paper as saying the man was "out shopping" when the attack started.

The Times said he is a "long-serving member" of Britain's elite SAS (Special Air Service). 

Pictures of the man, who wore jeans, a purple jumper and a balaclava, showed him rescuing survivors.

He was wearing body armour, holding an assault rifle and carrying a pistol. The British government does not comment on special forces.

Five gunmen with the Al-Qaeda-linked Somali militant group Al-Shabaab attacked the DusitD2 hotel and office complex in Nairobi on Tuesday, killing 21 people.

Kenya declared the attack over yesterday and said all five assailants were dead.

Security forces have resumed their search of the hotel complex, as information emerged about one of the attackers.

Police say one of the attackers was Ali Salim Gichunge, who was also known as Farouk.

He was traced through his car, which was used at the attack, to his home in the Ruaka suburb where he lived.

A detective who took part in the raid on the house said police had uncovered a "huge hole dug in one of the rooms where guns were stored".

Another police source, speaking on condition of anonymity, said they were confident there were no more people trapped inside the hotel or surrounding office buildings after the 20-hour assault, during which some 700 civilians were rescued.

"We are confident that we have no more people there," the officer said, "but in a situation like this, you are not done until you are done."

"We are back in with sniffer dogs and bomb experts are checking through because yesterday we found grenades left by those people."

Police warned the public there may be loud controlled explosions as they continued their sweep of the hotel. 

Chilling CCTV footage showed one of the attackers lingering in front of the terrace of the Secret Garden restaurant before blowing himself up. 

Four other attackers were shot dead by police during the operation to secure the hotel.

Al-Shabaab said it was acting to avenge the decision by US President Donald Trump to declare Jerusalem as Israel's capital, according to the SITE monitoring group.