ISLAMABAD, Pakistan — Pakistan understands it must take quick action against any terrorists connected to the Mumbai attacks that are living in the country, Sen. John McCain said Saturday after meeting its leaders.

Indian authorities say the attackers were members of a banned Pakistani militant group that was set up by the country's intelligence agencies to battle Indian rule in the disputed Kashmir region.

The attacks have ratcheted up tensions between the nuclear-armed countries, which have fought three wars in the last 60 years.

Asked about the possibility that India may take military action if Pakistan does not react to its allegations, McCain said he believed Islamabad would cooperate with India and take timely "specific acts to avert any further deepening of this crisis.

"From our meetings we have had today we are encouraged that the government of Pakistan will show that cooperation in words and deed," he told reporters after meetings with Prime Minister Yousuf Raza Gilani and military leaders.

McCain came to Pakistan with Sens. Joseph Lieberman and Lindsey Graham as part of a tour as members of the Senate Armed Services Committee. They previously visited India.

Lieberman said he was encouraged that Pakistan "will not allow the terrorists to divide this country from either its allies in Washington or its neighbors in New Delhi."