Prime Minister David Cameron has urged people not to confuse Islam with extremism, while on a trade visit to Jakarta in Indonesia.
Mr Cameron said Indonesia should be held up as an example of a country where religion and democracy "can flourish together".
He also paid tribute to the Burmese government for being willing to introduce political reform.
He is also set to visit Malaysia, Singapore and Burma on his Asia tour.
The prime minister, who is being accompanied by UK company bosses on the trip, has stressed South East Asia's growing economic and political importance.
He has insisted the trip is about boosting UK jobs and investment.
During visits to Indonesia and Japan, Mr Cameron signed defence and aerospace contracts.
Towards the end of his time in Indonesia, he paid tribute to the country and said it should be held up as an example for other Muslim nations - especially those involved in the Arab Spring.
During a speech at Al Azhar university in Jakarta, he said that in just one decade Indonesia had begun a transformation from dictatorship to democracy - a feat which had taken other countries, including the UK - decades and centuries.
He said the UK and Indonesia had many similarities and shared interests and highlighted the 2002 terror attacks in Bali where hundreds died.
He said: "The attack on Bali was an attack on the world and it taught us just how the security of our countries is now so inevitably intertwined."
He said the attacks were just like 9/11 in the US and 7/7 in London, adding: "We were attacked by a group of people who wanted to set Islam at odds with the West and use a warped version of their religion to justify a campaign of hatred and violence."
He praised Indonesia's resilience and said the country had the ability to show the world how democracy should be.
Mr Cameron warned of the threat of extremists to democracy, while stressing extremism was not just found among Muslims.
The prime minister referred to the violence in Syria and said the longer President Bashar al-Assad stayed, the more likelihood there was for a "bloody civil war".
He praised the Burmese opposition leader, Aung San Suu Kyi, as well as the Burmese president for having the courage to push for reformation.
He said: "When the foundations of reform have been laid, like here in Indonesia, we must build democracy until it is fully established and unassailable".
Mr Cameron said corruption was a threat to democracy and he commended Indonesian President Susilo Bambang Yudhoyono for fighting corruption and said the UK was doing similar things.
Any non-governmental organisation which receives funding from the UK would have to be transparent about what it did with the money and the next step would be ensuring recipient governments did the same thing, he said.
He said Indonesia's "economic dynamism" was partly why he had embarked on his trade tour of the region.
Mr Cameron is now set to travel to Malaysia on Thursday, ahead of his expected historic visit to Burma - where he will be the first Western leader to visit since Aung San Suu Kyi's election to parliament.
The prime ministrer will hold talks with the Malaysian Prime Minister Najib Tun Razak, meet leading businessmen and sign an agreement on educational links.
Malaysia is the UK's second largest market in south-east Asia, with exports worth more than £1bn. The UK is looking to expand its presence in financial services and biotech industries.