Kenyan security forces, including commando teams and military helicopters, launched a "final assault" on the luxury shopping mall in Nairobi where a group of armed militants were holding around 30 hostages.

As night fell in the Kenyan capital a huge blast reverberated around the Westgate mall, where the attackers – thought to be members of the Somali jihadist group al-Shabaab – had been holed up since shooting their way into the shopping centre on Saturday afternoon.

Two hours later the Kenyan defence forces tweeted that they had rescued most of the hostages and secured most of the mall. Four soldiers were reported to have been injured during the operation and taken to hospital.

Heavy and sustained gunfire was heard from the mall for about five minutes early on Monday morning, a Reuters witness reported. The blast of gunfire was followed by a lull, and then a series of small, sporadic explosions.

Kenya's military had earlier said on its Twitter feed it was making every effort to bring the siege "to a speedy conclusion".

The carnage in and around the four-storey building, where heavily armed fighters opened fire on weekend shoppers on Saturday, claimed at least 68 lives with 175 people injured. That toll, which rose steadily throughout Sunday, was expected to climb higher.

Kenya's president, Uhuru Kenyatta, who lost a nephew in the attack, promised to punish those behind it "swiftly and painfully", and said Kenya "would not relent on the war on terror".

Barack Obama called Kenyatta to offer condolences and US support in bringing the perpetrators to justice .

The attackers had refused any attempts at negotiation, but an al-Shabaab spokesman demanded that Kenya withdraw its troops from Somalia, where they have been fighting Islamist militants since 2011. "If Uhuru wants peace from us, he should withdraw his troops from Somalia," Abu Musab told Reuters.

The likely reason the attackers chose Westgate became apparent as one embassy after another said some of its citizens had been murdered in the assault.

David Cameron confirmed that three Britons had died, and said: "We should prepare ourselves for further bad news." France said two of its citizens had died, both women.

Canada's prime minister, Stephen Harper, said that two Canadians had died, one of them a diplomat named as Annemarie Desloges, who served in Canada's high commission to Kenya.

The US government said the wife of one of its citizens working for the US Agency for International Development had been killed, while four Americans were injured.

Security sources said there were at least 10 attackers, including one woman, but there could have been as many as 15. One eyewitness, a 16-year-old Kenyan girl who escaped on Saturday, said the female militant might have been "mzungu", the Swahili for white person.

The possibility of a white attacker has fuelled speculation that a British terror suspect, Samantha Lewthwaite, nicknamed the "White Widow", could be involved in the plot. She was married to 7 July bomber Jermaine Lindsay, and was last year named on a Kenyan police wanted list over alleged links to a suspected terrorist cell.

Sunday began with a barrage of gunfire at 7am local time as Kenyan soldiers attempted to storm their way into the ground floor entrance to the mall's largest shop, the Nakumatt supermarket.

One of the soldiers who took part in the attack, speaking on condition of anonymity, said two Kenyan troops had been killed as they came under sustained heavy fire, including what appeared to be rocket propelled grenades. "They were very intelligent and they are well-armed," he told the Guardian. He said that the frequent exchanges of fire between security services and the attackers had been designed to drain their ammunition supplies.

A number of eyewitnesses inside the security cordon in the Westlands neighbourhood of Nairobi said Kenyan special forces, who had been assembling outside during the day, appeared to be assisted by foreign military advisers. Kenyan police, working with officers from the British high commission, succeeded overnight on Saturday in erecting a security cordon around the busy commercial district but fascinated crowds gathered on a hillside overlooking the mall and crowded access roads on all sides.

Kenyan state house spokesman Manoah Esipisu confirmed his government had received offers of help in the anti-terror operation from many nations including the UK and Israel, one of whose citizens was reported to own Westgate.

"We welcome all offers of help but this is a Kenyan operation," he said.

The attack, the worst Kenya has witnessed since the 1998 embassy bombings, may strengthen calls from the Kenyan government to abandon the trials of Kenyatta and deputy president William Ruto, due to start at the international criminal court at The Hague in November.