Alan Scherr, his daughter Naomi, 13,and wife Kia, left. Alan and Naomi were in the cafe of the Oberoi hotel Wednesday night when it came under attack.

The full scope of the horror and desperation of the terrorist attack on Mumbai began to come into focus on Saturday after Indian commandos finally took control of the last nest of resistance.

Government officials said Saturday afternoon that the death toll had risen to 162 and was likely to rise again. They also said 283 people had been wounded.

Most of the dead were apparently Indian citizens, but at least 18 foreigners were killed and 22 had been injured, said Vilasrao Deshmukh, the chief minister of Maharashtra State. At least five Americans were believed to have died in the attacks.

Investigations into the identity and number of the attackers continued Saturday night. The city’s police commissioner suggested Saturday that 10 militants had caused the mayhem. “With confidence I can say that 10 terrorists came in,” said the commissioner, Hasan Gafoor. “We killed nine of them and one was captured alive.”

His comments were confirmed by Mr. Deshmukh, although it remained unclear whether they might have been referring to 10 attackers coming in by sea to join accomplices who, according to unconfirmed local news reports, might have embedded themselves in Mumbai days before the attacks.

A senior Mumbai police inspector, Nagappa R. Mali, identified the captured suspect as a 21-year-old Pakistani man, Ajmal Amir Kasab. Mr. Mali said the man had a fourth-grade education and worked as a laborer.

Four other suspected terrorists were at the morgue at the JJ Hospital in Mumbai. Officials there put their ages between 20 and 25. All four were males.

Around dawn on Saturday, gunfire began to rattle inside the Taj Mahal Palace & Tower, one of about a dozen sites that the militants attacked in their rampage beginning Wednesday night. The terrorists never issued any manifestoes or made any demands, and it seemed clear from their stubborn resistance at the Taj that they intended to fight to the last.

It wasn’t long before flames were roaring through a ground-floor ballroom and the first floor of the Taj, a majestic 105-year-old hotel located in the heart of southern Mumbai.

But by midmorning, after commandos had finished working their way through the 565-room hotel, the head of the elite National Security Guard, J. K. Dutt, said the siege at the Taj was over. Three terrorists, he said, had been killed inside.

Mr. Gafoor, the police commissioner, said security forces were still combing through the hotel on Saturday afternoon and it was expected that they would find more bodies. One commando leader said earlier that his team had come across a single room in the Taj containing a dozen corpses or more.

With the battle over, Indian Army troopers outside the hotel could finally begin to stand down. They took pictures of each other with their cell phone cameras and, flashing broad smiles, gave the thumbs-up sign to onlookers.

Despite the troopers’ smiles, the brazen and well-coordinated assault, which lasted more than 60 hours, has thoroughly shaken Mumbai, which is the financial and entertainment capital of India.

The attacks have rattled India as well, raising tensions with neighboring Pakistan and prompting questions about the failure of the authorities to anticipate the tragedy or to react swiftly enough as it unfolded.

For the first time, after veiled accusations that Pakistan was involved in the assault, Indian officials specifically linked the attacks to their neighbor and longtime nemesis. India’s foreign minister blamed “elements in Pakistan,” spreading the repercussions of the attacks beyond India’s borders.

American intelligence and counterterrorism officials said Friday that there was mounting evidence that a Pakistani militant group — Lashkar-e-Taiba, which has long been involved in the conflict with India over the disputed territory of Kashmir — was responsible.

Pakistan has denied any involvement, and the government had offered to send the head of its spy agency, the Inter Services Intelligence directorate, to India to assist in the investigation of the attacks. But news agencies reported Saturday that Pakistan would instead send lower-ranking officials.

A spokesman for Yousuf Raza Gilani, the Pakistani prime minister, gave no reason for the change, agencies reported, nor did he say when a visit might take place.

The Indian authorities also were beginning to face sharp questions about why operations to flush out a handful of assailants at a Jewish community center and the Taj had not moved more rapidly.

A glimpse of the desperation and fear that the attack created could be seen Saturday at the back of the seven-story Taj: Bedsheets that had been knotted together hung from a number of broken windows. One chain of sheets, dropped from a sixth-floor window, reached less than halfway to the ground, another 45 feet below.

Yasin Ali, 25, the owner of a handicraft shop behind the hotel, said he had seen as many as 30 people using the sheets to escape the terrorists. They had shimmied down the sheets, dropped into a garden area near the hotel swimming pool and then run out a back gate. He said the escapees appeared to be hotel staff, kitchen workers and a few Westerners.

Later in the evening, the Taj garden took on the look of a crime scene as two investigators in blue gloves searched the grass for clues. To one side of the garden, a blue-tiled fountain continued to bubble and spurt.

The main success for the authorities had come Friday at the Oberoi, the other luxury hotel that had been attacked. (The other main targets were the Jewish center, the city’s principal train station, a hospital, a cinema and a café.) The authorities said two gunmen had been killed at the Oberoi and 93 foreigners — some of them wearing Air France and Lufthansa uniforms — had been rescued.

Survivors offered harrowing accounts of their ordeal, trapped on the upper floors of the high-rise hotel while gunmen prowled below. The National Security Guard said it recovered two AK-47s, a 9-millimeter pistol and some grenades.

Indian commandos said the attackers at both hotels appeared well trained in handling weapons and hand grenades, and they seemed to know the buildings’ layouts, indicating a high degree of preparation. Some were seen arriving by boat; others may have been registered guests at the hotels for days.

“AK-47s and hand grenades, how to use and deploy them, this is not something you just pick up,” said Bruce Hoffmann, a professor at Georgetown University and the author of “Inside Terrorism.”

“Soldiers spend months learning how to do these things. You can’t learn this over the Internet.”

The leader of a commando unit involved in a gun battle inside the Taj said Friday that his team found a gunman’s backpack, which contained dried fruit, 400 rounds of AK-47 ammunition, four grenades, Indian and American money, and seven credit cards from some of the world’s leading banks, he said. The pack also had a national identity card from the island of Mauritius.

The attackers were “very, very familiar with the layout of the hotel,” said the commander, who disguised his face with a black scarf and tinted glasses to hide his identity. He said the militants, who appeared to be under 30 years old, were “determined” and “remorseless.”

As the State Department reported that Secretary of State Condoleezza Rice had called President-elect Barack Obama twice to brief him on the attacks, American intelligence and counterterrorism officials said Friday there was mounting evidence pointing to the involvement of Lashkar or possibly another Pakistani group focused on Kashmir, Jaish-e-Muhammad.

The American officials cautioned that they had reached no conclusions about who was responsible for the attacks, or how they were planned and carried out. An F.B.I. team was being sent to Mumbai to assist with the forensic investigation. In a statement, President Bush said he was saddened by the deaths.

On Friday at the besieged Nariman House, home to the Hasidic Jewish group Chabad-Lubavitch, commandos slid down ropes from a hovering Army helicopter, landed on the roof and crept inside. After a gun battle that lasted more than five hours, troopers finally gained control of the building.

The bodies of at least five people were found inside, including a New York rabbi, Gavriel Holtzberg, who held dual American and Israeli citizenship, and his wife, Rivka, an Israeli citizen. The couple ran the center at the Nariman House. Another was that of Rabbi Leibish Teitelbaum, a Brooklyn native who moved to Jerusalem several years ago, according to a statement by Mayor Michael R. Bloomberg.

On Saturday afternoon, an Israeli government team was at the JJ Hospital in Mumbai, looking for information on possible Israeli victims. About 1:30 p.m., the team identified one of the dead at the morgue there, a woman, as an Israeli. Her identity was not immediately disclosed.

The dead at the Oberoi included a 58-year-old man and his 13-year-old daughter, members of a spiritual community visiting from Virginia, who were shot in the lobby. They were among at least five Americans who were killed, the State Department said.

R. R. Patil, the home affairs minister of Maharashtra State, where Mumbai is situated, said the assailant who had been captured alive was a Pakistani citizen. The Indian foreign minister, Pranab Mukherjee, said early evidence explicitly pointed to Pakistan’s involvement. “Preliminary evidence, prima facie evidence, indicates elements with links to Pakistan are involved,” he told reporters in New Delhi.

“On a number of different levels, these attacks are alarming,” Mr. Hoffman said. “Outside of the zones of warfare, since 9/11 there haven’t been major, major terrorist attacks. There’s been this lull, and the thought that perhaps we’ve turned a corner on this.

“But this just reminds us that terrorism remains an international problem.”