Indonesian cleric Abu Bakr Bashir has walked out of a Jakarta jail after serving time for links to the 2002 Bali bombings.
He planned to return immediately to an Islamic school in central Java.
Bashir on Wednesday was surrounded by supporters shouting "Allahu Akbar" (God is great) and by media before getting into a car and being driven away.
Seen by the West as the spiritual head of the al-Qaeda-linked Jemaah Islamiya (JI) regional network, Bashir was convicted of being part of a conspiracy behind the Bali bombings that killed 202 people, many of them Australian tourists.
Southeast Asian and Western authorities blame JI for the Indonesian resort island attack and other strikes in the region.
Hundreds of Bashir supporters were outside the jail waiting to welcome him on Wednesday. Scores of police were also on hand and security was tight.
Bashir's son, Rohim, told reporters: "I'm very happy right now. All things have been resolved, and he is free now."
Asked about possible police surveillance of his father, he said: "I don't care about it. If they want to watch, go ahead."
Australian and US officials have in the past criticised Indonesia, the world's most populous Muslim nation, for giving the cleric a relatively light sentence and for subsequently reducing the term.
Analysts say militants could use Bashir's release to revive JI, which police say has become decentralised, with factions splitting off and operating independently.
"The perception among security forces is that the release may help consolidation moves as they (JI) have been torn after the death of their leader," said Andi Widjajanto, a security analyst at the University of Indonesia.
Azahari bin Husin, the network's alleged leader, was killed in a police raid late last year.
Bashir was arrested several days following the 2002 Bali blasts for investigations on separate crimes and later spent 18 months in jail for minor immigration offences after treason charges against him were dismissed or overturned in court.
Police rearrested him for suspected links with the Bali attacks as he was leaving prison in April 2004. A court last year sentenced him to 30 months in jail after finding him guilty of being part of a conspiracy behind the bombings.
The 67-year-old cleric, who has called al-Qaeda leader Osama bin Laden a true Islamic warrior, denies any wrongdoing. He insists JI does not exist, and Indonesian courts have dismissed charges that he led the network.