Prime Minister Tony Blair has promised to work closely in the fight against terrorism with Indonesia, home to the world's largest Muslim population.
Indonesia is South East Asia's most populous country
Mr Blair was speaking after meeting President Susilo Bambang Yudhoyono for an hour in the capital, Jakarta.
He also met moderate Islamic leaders who criticised his foreign policy and called on Britain to pull out of Iraq.
Mr Blair has visited New Zealand and Australia as part of a tour of the Asia-Pacific.
After the meeting between the two heads of state, Mr Blair described Indonesia as a "crucial partner" in ensuring greater understanding of people of different faiths.
On terrorism, Mr Blair said: "Both our countries have suffered from terrorism and have a common interest in defeating it and we will work together on that."
Mr Yudhoyono added that the two countries had "agreed to increase the efficiency" in their efforts to fight "trans-national crimes like terrorism".
Later, Mr Blair met leaders from some of the country's most influential Islamic groups which he described as an "inspiring and at times moving occasion".
One of the Islamic leaders, Din Syamsudin of the Muhammadiyah group, said he told Mr Blair to withdraw his troops from Iraq.
"The occupation is only promoting more radicalism and new acts of terrorism," the Associated Press quoted him as saying.
Islamic scholar Azyumardi Azra said he told the UK prime minister "his foreign policies were not making the world any safer", AP reported.
'Harmony and peace'
Mr Blair also visited an Islamic boarding school twinned with a school in West Yorkshire - a twinning scheme which, it is hoped, will be extended to 1,000 schools.
After singing John Lennon's Imagine and treating the prime minister to displays of martial arts and dancing, the pupils asked Mr Blair questions about his foreign policy.
In response to questions about Iraq, Mr Blair told the children Iraqi people could now vote, and that he believed "people of different faiths can live together in harmony and peace".
Mr Blair's visit is the first by a British prime minister to Indonesia in two decades.
The country, which has a population of about 225 million, has developed close business ties with Britain and the US.
The BBC's correspondent in Jakarta, Tim Johnston, says Indonesia is increasingly being seen as a vital bridge between Western and Islamic nations.