The Indonesian Islamic cleric believed to be the spiritual leader of the Jemaah Islamiah (JI) group has urged his followers to stay true to their faith.
The rally was called to show support for Mr Ba'asyir
In a message from his prison cell, Abu Bakar Ba'asyir said Muslims should strive to impose Islamic law without fear of being labelled terrorists.
JI members are suspected of both the bomb attack on a luxury Jakarta hotel this week and the Bali bombings last year.
Some 3,000 people, many in paramilitary uniform, gathered in the open air in Solo, central Java, on Sunday to hear their leader's words.
"Do not be afraid of being labelled as trying to overthrow [the government] or as terrorists when you are carrying out
Islamic Sharia [law]," he said in the message, read out by one of his deputies.
Mr Ba'asyir is himself facing trial for attacks on Christian churches and treason.
The crowds in Solo, where Mr Ba'asyir has his power base and runs a religious school, shouted "God is Great" in response.
Mr Ba'asyir also warned the Indonesian Government against arresting religious leaders and teachers.
Many of the suspects in the Bali bombings, as well as the chief suspect in Tuesday's attack on the Marriott Hotel, went to Mr Ba'asyir's school.
Mr Ba'asyir denies JI even exists
Indonesian Defence Minister Matori Abdul Djalil has named JI as the prime suspect in the Marriott attack, in which 10 people died.
He also linked the group to al-Qaeda, saying that members had trained with the group in Afghanistan and Pakistan.
The US has warned that militants may be planning more terror attacks against its interests in Indonesia.
At least 33 suspected JI members are either on trial, or awaiting trial, for the Bali attacks which killed 202 people, many of them tourists.
The group was formed in the mid-1980s by two Indonesian clerics.
Its principal goal is the establishment of a unified South East Asian Islamic state stretching from southern Thailand, through the Malay Peninsula, including Singapore and across the Indonesian archipelago, and into the southern Philippines.