At a joint news conference with General Pervez Musharraf, the Pakistani president, Bush said: "Part of my mission today was to determine whether or not the president is as committed as he has been in the past to bringing these terrorists to justice, and he is."
The statement on Saturday came after lengthy talks between the two leaders.
Late on Saturday Bush left Pakistan, an official said, wrapping up a landmark maiden tour of South Asia during which he also visited Afghanistan and India.
While Bush and Musharraf met in Islamabad, Pakistani soldiers killed at least 46 Muslim fighters during heavy fighting in a remote tribal belt bordering Afghanistan, security officials told AFP.
About 25 died in Mir Ali, a town in the North Waziristan tribal
region, while another 21 were killed in another location near the area's main town of Miran Shah, the officials said.
"The death toll is known to us through various communication
intercepts from the militants. They are communicating their losses," said one official who is based in the northwestern city of Peshawar.
Three Pakistani soldiers were also killed in the clashes with the tribesmen, who officials say are seeking vengeance for the deaths of nearly 40 fighters in an army raid on a nearby training camp on Wednesday.
Pakistani soldiers are battling
Muslim fighters in the tribal belt
Bush said of Musharraf: "He understands the stakes, he understands the responsibility and he understands the need to make sure our strategy is able to defeat the enemy."
The US president said the main concerns were making sure that intelligence was shared between the two countries and that Pakistan had the equipment and resources to move on "terrorists" and their hideouts.
Asked whether the US would help Pakistan with a civilian nuclear programme, as it has promised to do with India, Bush noted that the two countries had different needs and histories.
Anti-American sentiment runs deep in Pakistan, and protests flared across the country in anticipation of Bush's visit.
A day before Bush's visit, an American diplomat was killed in a suicide car-bombing at a US consulate in the southern city of Karachi.
Musharraf said he was glad the Karachi attack had not derailed Bush's visit, and reaffirmed his country's commitment to supporting the US-led "war on terrorism".
"It's very clear that the intentions of Pakistan and my intentions are absolutely clear - that we have a strategic partnership on the issue of fighting terrorism," Musharraf said.
"If there are slippages, it is in the implementation part. We are moving forward toward delivering and we will succeed."
In some protests, demonstrators burned American flags and chanted "Death to Bush".
Bush's visit has been met with
angry protests by Pakistanis
About 1000 stone-throwing people tried to march on the US consulate in Karachi; police used tear gas and batons to stop them.
A six-party opposition religious alliance called for black flags to be flown over homes and was staging demonstrations in Lahore, Karachi and Quetta.
Pakistani police also detained Imran Khan, best known for leading Pakistan's cricket team to a 1992 World Cup victory, ahead of a protest planned by his small opposition party, according to Khan's spokesman.
Khan has often sided with Islamic parties in voicing criticism of the US-led war on terror and Musharraf's rule.
The American president also showcased the more than $500 million the US has pledged to help victims of the devastating earthquake that hit Pakistan in October.
Musharraf also pleaded for the US to remain engaged in the long dispute between Pakistan and India over Kashmir, which is divided between the South Asian rivals.
In a farewell speech in New Delhi, Bush ran into trouble when he praised Pakistan as "a force for freedom and moderation in the Arab world".
Both claim the Himalayan region, and have fought two wars over it.
The White House hastened to correct Bush's reference to Pakistan as an Arab nation, and said he meant to say in the Muslim world.