There was a dramatic confession in an Indian courtroom Monday, as the only surviving gunman in last November's deadly attacks in the Indian city of Mumbai, pleaded guilty.

Mohammad Ajmal Amir Kasab stood up during his trial at a special court set up to try him, and addressed the judge. "Sir, I plead guilty to my crime," he said. The plea triggered gasps in the courtroom.

The 21-year-old is charged on 86 counts, including waging war against India, murder and possessing explosives.

A total of 166 people were killed in the attacks by 10 gunmen in Mumbai, India's financial capital, that began Nov. 26. It ended three days later with troops storming the Taj Mahal Hotel where some gunmen were holed up.

It was not immediately clear what prompted Kasab to make the statement after consistently denying he was guilty.

"Everybody in the court was shocked the moment he said he accepts his crime. It was unexpected," public prosecutor Ujjwal Nikam said.

Kasab, however, claimed his testimony was not coerced.

"There is no pressure on me. I am making the statement of my own will," he said.

His statement was recorded in court after a long debate about the legality of the confession. The judge, M.L. Tahiliyani, said Kasab would have to sign each page of the document outlining his confession.

If the confession holds up in court it will be a big boost to India's claims that terrorist groups in Pakistan were behind the attack, and that Islamabad was not doing enough to clamp down on them.

No judgment was issued and Tahiliyani said the trial would continue Tuesday.

The allegations have severely strained relations between the two nuclear-armed archrivals.

Pakistan has acknowledged the Mumbai attacks were partly plotted on its soil.

In his lengthy statement, Kasab gave details of his group's journey from Pakistan on a boat, their subsequent landing in Mumbai, and the bloody rampage that followed as the gunmen shot and killed people at a railway station, a Jewish center and two five-star hotels, including the Taj Mahal.

He also explained how he had become involved with the Islamic extremist group known as Lashkar-e-Taiba, after he became dissatisfied with a low-paying job in the town of Jhelum, Pakistan.

The young gunman said he went to Rawalpindi, hoping to become a professional robber and make contacts with people who could train him. Kasab and a friend then sought out the mujahedeen.

Eventually, Kasab spent a month-and-a-half training with 10 other fighters in Karachi, Pakistan's largest city.

Kasab was arrested after a shootout with police on the first day of the attacks. He was treated for wounds and has since been held in solitary confinement in Mumbai's Arthur Road Jail.

All of the other attackers were killed.

On June 22, arrest warrants were issued for 22 Pakistani nationals, including the founder of Lashkar-e-Taiba, Mohammed Saeed.

With files from the Associated Press