CBS News Correspondent John Roberts, reporting from Bali, says security was extremely tight as Mr. Bush visited the nation which is home to at least two terrorist groups with links to al Qaeda: Abu Sayyef and Jemaah Islamiyah.
A year ago, militants belonging to the al Qaeda-linked Jemaah Islamiyah group blew up two Bali nightclubs, killing 202 people, mostly foreign tourists, in the largest terror attack since Sept. 11, 2001. On Monday, Indonesia's security minister warned that a fresh attack was imminent.
At least 5,000 police and army troops were deployed for the Bush visit to Bali, which was limited to just three hours because of security concerns. Tanks and other armored military vehicles were stationed around Bush's hotel, where officials ordered guests to stay in rooms, or leave the grounds until he left.
Secret Service agents searched trees, fountains and used flashlights to peer into grates.
Concluding his visit to Bali Wednesday, Presidents Bush and Sikarnoputri held a joint news conference at which Mr. Bush discussed the push for peace in Indonesia and in other parts of the world, including Korea and Iran.
Speaking in what is the world's most populous Muslim nation, the U.S. president defended his foreign policy against criticism from some that it is slanted toward Israel and against Islam. He reiterated his support of a Palestinian state.
"We know that Islam is fully compatible with liberty, tolerance and progress because we see the proof in your country and our own," said Mr. Bush.
President Bush pointed to the encouraging sign of Iran's decision to accept "the demands of the free world" and suspend its uranium enrichment program. At the same time, he brushed off North Korea's rejection of his overtures to end the nuclear crisis there.
The Korean nuclear crisis has shadowed Mr. Bush on this week's Asian trip. On Wednesday, Pyongyang branded as "a laughing matter" the U.S. offer of a written pledge from five countries not to attack if the communist nation scraps its nuclear weapons program.
President Bush said he will "stay the course" despite Pyongyang's dismissal.
"We'll continue to send a very clear message to the North Koreans," he said. "The good news is that there's other nations besides America sending the message."
President Bush spoke a day after Iran agreed to suspend uranium enrichment and give inspectors unrestricted access to its nuclear facilities as demanded by the U.N. atomic watchdog agency, a step that could ease another nuclear weapons standoff.
"The Iranians, it looks like they're accepting the demands of the free world, and now it's up to them to prove that they've accepted the demands. It's a very positive development," said Mr. Bush.
Megawati pledged cooperation with the United States in the pursuit of global peace, while acknowledging that many of her citizens are suspicious of the United States.
"Despite the fact we do not always share common perspective, we must continue to hold mutual understanding that it is to the interest of the two countries to maintain consultation and cooperation in the pursuit of global peace," Megawati said.
Anti-American sentiment is rampant in Indonesia, with a huge decrease in recent years in those with favorable views of the United States, as many are furious over the U.S.-led war in Iraq and U.S. policy in the Middle East. While Megawati is viewed as an ally in the war against terror, she told the United Nations last month that the war created problems that it was supposed to solve.
Mr. Bush attempted to address some of those problems in remarks directly challenging the claims of Islamic militants.
"Terrorists who claim Islam as their inspiration defile one of the world's great faiths," said Mr. Bush. "Murder has no place in any religious tradition (and) must find no home in Indonesia."
Just before President Bush spoke, a loud blast shook Makassar, the main city of Indonesia's Sulawesi island, about 375 miles northeast of Bali, but caused no damage, police said. It wasn't immediately clear what had caused the blast.
The security meant that there were no crowds waiting to see the American president. Earlier, about 40 people demonstrated against President Bush on the road leading to the hotel. "Hang Bush, he's a terrorist," read a sign carried by one protester.
But interviews with residents suggested many supported Bush.
"All the Balinese are happy that Bush is coming," said Made, a tour operator, who like many Indonesians uses only one name. "If he remembers the good times he had in Bali when he goes back to America, maybe he'll lift the travel warning."
The State Department warned in August that Americans should defer all non-essential travel to Indonesia because "the potential remains throughout Indonesia for violence and terrorist actions against U.S. citizens and interests." The warning has hurt Indonesia's tourist industry.
Mr. Bush met with five religious leaders, including moderate Muslims, some of whom have criticized him; a Hindu cleric; and a Roman Catholic priest. "Americans hold a deep respect for the Islamic faith, which is professed by a growing number of my own citizens," Bush said.
The president announced a six-year, $157 million program for Indonesia to help improve education and counter the anti-American message in many classrooms.
The Bush administration says Megawati has taken effective steps against terrorism, particularly since the Bali bombings. About 100 Jemaah Islamiyah members have been arrested and 29 people connected with the Bali bombings have been convicted.
However, Jemaah Islamiyah has been able to regroup, appointing dozens of people to carry out new attacks on Western targets in Asia between December and April, a senior Indonesian intelligence adviser told The Associated Press.