The world's most populous Muslim nation has been praised by US President Mr George W Bush for supporting the war on terror, but he has told Indonesia that Islamic extremists have defiled a great religion.
But Mr Bush ran afoul of leading moderate Muslim clerics during talks on the Indonesian resort island of Bali, where Islamic militants linked to al Qaeda blew up two nightclubs packed with foreign holidaymakers just over a year ago, killing 202 people.
Reflecting growing mistrust of the United States among ordinary Indonesians, the clerics criticised Washington for supporting Israel over the Palestinians and for the occupation of Iraq.
They said Mr Bush needed to listen more to the opinions of the rest of the world.
Mr Bush, speaking against the backdrop of a palm-fringed beach and turquoise sea, expressed his gratitude to Indonesia after meeting President Megawati Sukarnoputri and the clerics.
"We know that Islam is fully compatible with liberty and tolerance and progress because we see the proof in your country and in our own," he told a news conference.
"Terrorists who claim Islam as their inspiration defile one of the world's greatest faiths. Murder has no place in any religious tradition. It must find no home in Indonesia."
US officials said Mr Bush wanted to correct what he felt was a misconception that the war on terror was a cover for a war against Islam.
The US president paid the brief visit to Bali under blanket security before flying to the Australian capital Canberra for talks with key ally Prime Minister Mr John Howard as part of a six-nation tour.
He paid tribute to the victims of the Bali bombings, the worst global act of terror since the September 11th, 2001, hijack attacks on the United States.
Indonesia took no chances with security, deploying seven warships along with 5,000 heavily armed police and troops backed up by sniffer dogs and bomb squad units for the visit.