Updated

An Indonesian militant was convicted of helping to build the massive car bomb used in the deadly 2002 Bali nightclub attacks and sentenced to 20 years in prison Thursday, concluding the trial for the case's last main defendant.

Known as "Demolition Man," Umar Patek, 45, is a leading member of the Al Qaeda-linked network Jemaah Islamiyah. He was found guilty by the West Jakarta District Court of violating the country's anti-terror law for his role in the Oct. 12, 2002 Bali resort island attacks that killed 202 people, including 88 Australians and seven Americans.

The five-member judge panel also sentenced him for his involvement in Jakarta church attacks on Christmas Eve in 2000 that killed 19.

Prosecutors had sought a life sentence for Patek, who was accused of illegal weapons possession, concealing terrorist acts, immigration violations and premeditated murder in the Bali bombings.

More than 240 police, including a team of snipers, were deployed in and around the court building for the last session of the trial, which began in February. Several sharp shooters were seen atop nearby buildings.

Judges took turns reading lengthy documents summing up the trial ahead of the verdict and sentencing. Except for a few relatives, the courtroom was packed mostly by reporters, photographers and cameramen instead of the defendant's supporters. His Filipino wife, Ruqayyah binti Husein Luceno, 28, was sentenced in January to 27 months in jail for immigration violations.

Patek, who was arrested last year in Pakistan in the same northwestern town where Osama bin Laden was killed several months later, was the last key defendant to be tried in the attacks. He argued that he did not play a major part in building the car bomb, which was the biggest explosive used in the attacks. Instead, he said bomb-making masterminds Azahari bin Husin and Dulmatin were in charge of that job. Both have since died in police raids.

Patek, whose real name is Hisyam bin Alizein, has apologized to the victims' families, Christians and to the government, saying he was not in favor of going through with the attack against partying tourists, but that he could not speak out against other senior members of the group. The mission was supposedly meant to avenge Western policies in the Palestinian territories, but Patek argued that he never saw the connection.

The militant could have faced a maximum penalty of death by firing squad for the various terror-related and criminal charges. He can appeal Thursday's ruling to a higher court.

Clad in a white cotton robe and matching pants with his hair and beard dyed a coppery red, the defendant sat quietly for hours as the judges read out their 273-page ruling, which included testimony from Patek and more than 40 witnesses. Their verdict and sentencing was read at the end, after the session had stretched into evening hours.

The Bali bombings marked Indonesia's deadliest terror strike. On Saturday, Oct. 12, 2002, a suicide bomber blew himself up inside a nightclub jammed with tourists at popular Kuta beach, killing many instantly and forcing others to run outside. Another suicide bomber detonated the massive bomb loaded in the car parked on the street in front of two clubs.

Patek admitted he helped make the bombs, but said he did not know how they would be used. Prosecutors argued he helped assemble the suicide vests as well as detonating cords and boosters connected to the explosives.

He left Bali just before the attacks and spent nine years running from the law, traveling in the Philippines and Pakistan. He had a $1 million bounty on his head and was considered one of Asia's most wanted terror suspects.

Since the Bali bombings, Indonesia -- the world's most populous Muslim nation -- has been rocked by other attacks targeting restaurants, luxury hotels and a Western embassy. Security experts say those have all been less deadly partly because a crackdown on Jemaah Islamiyah has crushed its ranks.