The government reports that a major operation has freed most of the hostages at the shopping mall in Nairobi, where a terrorist attack left at least 68 dead.

NAIROBI, Kenya — Security forces launched what they called a final assault late Sunday against Somali militants holed up in a high-end shopping mall, claiming they had freed most of the hostages being held by the gunmen and seized control of much of the building.

Military and police helicopters circled low over the multi-story Westgate mall and gunfire rang out throughout the day. As darkness fell, beginning the second night of the siege, a large explosion shook the area.

The Kenya National Disaster Operation Center said a major operation was unfolding to end the terrorist attack that killed at least 68 people and injured 175.

"This will end tonight," it declared. "Our forces will prevail. Kenyans are standing against aggression and we will win."

A military spokesman reported on Twitter that by 11 p.m., "most of the hostages have been rescued and security forces have taken control of most parts of the building." But officials did not say how many hostages had been freed, and offered little information about their condition. They also did not detail the fate of the captors. The military spokesman told the BBC late Sunday that perhaps 10 hostages were still being held.

As the night wore on, no gunfire could be heard from outside the mall. The spokesman said on Twitter that four Kenyan soldiers had been wounded.

"All efforts are underway to bring this matter to a speedy conclusion," the spokesman said.

Among the dead were three Britons, two French, two Canadians, a Chinese citizen, a Dutch citizen and renowned Ghanaian poet Kofi Awoonor. U.S. officials said a number of Americans were at the mall at the time of the attack, and four were wounded.

President Uhuru Kenyatta told reporters that his nephew and his nephew's fiancee were killed in the Westgate mall.

"These are young, lovely people who I personally knew and loved," he said. "No one should lose their lives so needlessly and so senselessly and no family should have to receive news that their loved one has been killed by a criminal bunch of cowards."

But he said it was remarkable that 1,000 people got out alive.

Several people managed to escape Sunday, including one who had hidden under a car in the basement, and another who lay concealed under supermarket shopping carts.

The assault, which began around noon Saturday, was carried out by between 10 and 15 attackers, by some estimates. It left Kenyans dazed and fearful of future attacks. But they expressed unity on social media networks, tweeting under the hashtag #WeAreOne. Hundreds of people lined up, some for hours, to give blood. Many others donated money for the victims.

An unnamed spokesman for the Shabab, the militant group that claimed responsibility for the attack, told Britain's Channel 4 that the mall was singled out to inflict maximum pain for Kenyans and to gain maximum attention. The group said the attack was in revenge for Kenya's 2011 invasion of Somalia that was aimed at controlling the Islamic militants.

The Shabab, which is linked to Al Qaeda, warned foreigners to stay out of Kenya, calling it a war zone. "For us, anywhere in Kenya is the same. We will hit them wherever we can," the group's spokesman said.

Twitter accounts attributed to the Shabab were closed Saturday. A new account launched Sunday reported that the attackers included a number of Americans. However, analysts said they could not verify the account. A senior State Department official said the U.S. government could not confirm that Americans were involved, and was seeking more information.

The weekend attack is likely to have a devastating effect on Kenya's tourism industry, further damaging an economy that has weathered successive blows caused by terrorist attacks, kidnappings of Westerners and postelection violence in 2007 and 2008.

In a sign of how worried Kenyan authorities are about the potential blow to tourism, Kenyatta urged Western governments not to issue travel warnings advising people to avoid his country.

Some Kenyans were frustrated that security forces did not launch an assault sooner. Kenyatta had urged patience, saying the priority was to save hostages' lives.

One onlooker outside the mall, student James Mwangi, 19, said he would not leave until the operation was over, because he was desperately waiting for news about relatives stuck inside.

"This terrorism attack is going to have a very bad impact on the tourism industry. Tourists will think security is not up to standard. The tourism industry will face losses from that," Mwangi said.

Joel Mbugwa, a porter, also part of the crowd watching the building from a distance, was angered by how long the police and military operation was taking.

"Why can't the police and army just go in and shoot these people?" he said. "There are hostages in there and [the attackers] will just kill them."

Mbugwa said the Kenyan government made a big mistake by sending its army into Somalia to fight the Shabab.