Kenya's military has said that it has freed most of the hostages at a shopping centre in Nairobi.

Islamist militants have been holding hostages where at least 68 people were killed in an attack by the Somali al-Shabaab group.

The group has demanded that Kenya pull troops back from its neighbour.

Brief volleys of gunfire and a blast interrupted hours of stalemate.

A Reuters correspondent saw security personnel on the move and, as dusk closed in, two helicopters swooped low over the Westgate Mall.

Mobile phone signals began to fail in the area as darkness fell.

Kenya's president, vowing to stand firm against Somali militants, was cautious about the outcome, saying chances of the attackers being "neutralised" were "as good ... as we can hope for".

He said: "We will punish the masterminds swiftly and painfully." 

In addition to the dead, more than 175 people were injured in an attack that began around the middle of the day yesterday, when the mall was heaving with customers.

Officials did not say how many hostages were being held,although one Kenyan television station cited a figure of 30.

Trapped individuals emerged, dwindling as the day went on.

The focus of attention today was the shopping centre's branch of Nakumatt supermarket, one of Kenya's biggest chains.

A Red Cross volunteer said nine more bodies were taken out of the store late today, which the Red Cross said raised the toll to 68.

Volunteers said they believed more corpses were still inside, unreachable for now.

British Prime Minister David Cameron, confirming three Britons were dead, said: "We should prepare ourselves for further bad news."

US President Barack Obama called Kenyan President Uhuru Kenyatta to offer condolences and support.

Foreigners including a French mother and daughter and two diplomats from Canada and Ghana were killed in yesterday's attack, which was claimed by al-Shabaab.

Other victims came from China and the Netherlands, US citizens were injured.

Shortly after today's shots were fired, troops in camouflage ran below a restaurant terrace along the front of the building that had buzzed with customers when the attack began.

Tánaiste Eamon Gilmore said: "I condemn in the strongest possible terms the terrorist attack at the Westgate Shopping Centre in Nairobi."

He said: "I express my deepest sympathy to the families of the deceased and injured. We are following the situation as it develops through our Honorary Consulate in Nairobi and our Embassy in Dar es Salaam."

Mr Gilmore concluded: "Ireland and our EU partners will stand in solidarity with the government and people of Kenya at this most difficult time."