Asif Ali Zardari made the comments late Sunday just hours after President Barack Obama urged the two nations to resolve their differences through dialogue. Obama was speaking to students in Mumbai, where he was on the second day of a four-day visit to India.

The US president  said in Delhi that he was ready to play “any role” requested by India and Pakistan to foster peace between them as he moved delicately to address tensions between the neighbors.

“We are happy to play any role the parties think is appropriate,” Obama said at a joint news conference with India’s Prime Minister Manmoham Singh.

After the news conference, Pakistani Foreign Minister Shah Mehmood Qureshi reiterated that his country was willing to talk to India and was committed to eliminating terrorism and dismantling any networks operating from his country.

“We condemn terrorism. We do not and will not allow Pakistani soil to be used against anyone and that includes India,” he told India’s CNN-IBN news channel. “We have taken considerable steps in the last two years to deal with this situation.”

Better ties between India and Pakistan would help Washington in the war in Afghanistan because it would allow Islamabad to shift troops to the western border to fight militants there.

Moreover, Pakistan’s alleged support for the Taleban in Afghanistan is motivated partly by its fear of Indian influence there.

Islamabad invited India’s foreign minister for talks in July in Islamabad, but they achieved little except public recriminations on both sides.

“The democratic civil government went out of the way in our peace overtures toward India,” Zardari said in a speech to a South Asian journalist association, a copy of which was released Monday. “It would have been most helpful if our initiatives had been welcomed and responded to in a positive manner.” Zardari said Pakistan was cooperating in bringing to justice those behind militant attacks.

Pakistan has arrested seven people in connection with the Mumbai attacks, but their trials have not properly begun yet.

Pakistan’s army and spy agencies — which operate largely out of the control of Zardari’s government — have for years treated militants who attack India as allies, not enemies. Analysts say they have not fully severed their ties with such groups.