Asahara, founder of the apocalyptic Aum Shinrikyo cult, also was convicted of ordering his followers to produce and stockpile arsenals of conventional and chemical weapons, including the sarin gas used in the subway attack.
Asahara, 48, stood in silence as the sentence was read. Asahara is the 12th person sentenced to hang for the attacks, and the decision was widely expected. None of the 12 has been executed.
Presiding Judge Shoji Ogawa, who led a four-judge panel, detailed Asahara's crimes before announcing the sentence, saying they expanded from individual murders to "indiscriminate terror attacks using chemical weapons."
"His crimes not only affected families and relatives of the victims but also threw our country and neighboring countries into extreme fear," Ogawa said. "They involved a series of extremely vicious acts that none of us had experienced before."
Japan has no jury trials.
The former cult leader's attorneys immediately appealed, arguing that prosecutors ignored testimony showing Asahara was not behind the crimes, lead defense lawyer Osamu Watanabe said.
"The court did nothing but put the final touches on the prosecution's argument. It's an empty verdict," Watanabe said.
The appeal could prolong the case for another decade, some say.
Watanabe added that the defense team would resign after filing the appeal.
During the eight-year trial, defense attorneys argued that Asahara whose real name is Chizuo Matsumoto lost control over his flock by the time of the March 20, 1995, subway attack that killed 12 and sickened thousands.
The attack sent the country into a panic as sickened, bleeding passengers stumbled from subway stations, shattering the image of Japan as a peaceful, largely crime-free country.
The prosecution, however, depended on testimony from former followers who said Asahara planned and ordered their murderous deeds.
"Given the seriousness of the crime, the death sentence is a given," Prime Minister Junichiro Koizumi said, according to the Asahi newspaper's Web site. "But it would have been better if the trial had ended sooner. It must be unbearable for the victims. I understand their frustration."
Asahara also was convicted of masterminding a June 1994 sarin gas attack in the central city of Matsumoto, the murder of anti-Aum lawyer Tsutsumi Sakamoto and his family, and the killings of wayward followers and people helping members leave the cult.
At its height, Aum claimed 10,000 followers in Japan and 30,000 in Russia. The guru used a mixture of Hinduism, Buddhism, Christianity and yoga to entice his devotees, who engaged in bizarre rituals such as drinking his blood and wearing electrical caps that they believed kept their brain waves in tune with his.
Many terrorism experts also point to Aum's weapons program as an early indication of how individual groups, not only national governments, could use money and technology to compile arsenals of weapons of mass destruction.
The families of victims welcomed the verdict.
"It was good to hear the death sentence that I had been hoping for," said Shizue Takahashi, widow of a train worker killed in the subway sarin attack. "I visited my husband's grave this morning and I came to hear the ruling with his spirit."
Some said they were saddened that Asahara never acknowledged responsibility for the crimes or apologized to victims. He rarely spoke during the trial, only occasionally babbling incoherently in broken English.
"This death sentence is not enough," said Yoko Ito, whose daughter was killed in the Matsumoto gas attack. "I was hoping that he would say something, but it's very disappointing that the verdict ended in silence."
Security was tight at Tokyo District Court to guard against disruptions by Asahara followers, and media reported that a decoy was used on the way to the court Friday to thwart any attempt to free the ex-guru. Some 4,600 people turned out for a chance at the 38 courtroom seats available to the public and chosen by lottery.
The subway gassing was Aum's most horrific crime. Five cult members pierced bags of sarin originally developed by the Nazis on separate trains as they converged in central Tokyo's national government district as a pre-emptive strike against police planning raids on the cult.
Survivors still suffer from headaches, breathing troubles and dizziness. The cult was ordered in separate court proceedings to pay 3.8 billion yen, or US$35 million in damages to the victims.
Aum's weapons program was carried out by highly educated scientists from Japan's best schools. Asahara's flock was bewitched by his predictions of an Armageddon that only cult members would survive.
The trial was lengthened by Japan's chronic shortage of lawyers and judges, the complexity of the case and a six-month delay caused by Asahara's firing of his first attorney.
Police say the cult's remnants renamed Aleph since 2000 show signs of greater allegiance to Asahara. Agents this month raided the offices of the group, which still claims 1,650 members in Japan and 300 in Russia.
The group released a statement after the verdict, apologizing to the families of victims of Aum's crimes and vowing to compensate them.