The prime ministers of India and Pakistan agreed Wednesday to resume formal talks over a territorial dispute that intensified after both countries conducted nuclear tests in May.

It was the first face-to-face encounter between Indian Prime Minister Atal Bihari Vajpayee and his Pakistani counterpart, Nawaz Sharif, since they ordered the nuclear test blasts, stirring worldwide condemnation."Nawaz Sharif and I have agreed that the dialogue process should be resumed," said Vajpayee. He said top ranking officials will work out details of the future talks.

The 75-minute meeting at a sea front hotel in Sri Lanka's capital city was held during a break in a seven-nation regional summit.

"I had a very good meeting," Sharif said, speaking to reporters after Vajpayee left. But he said India needed to show more flexibility on the question of Kashmir, the disputed Himalayan territory over which the two countries have fought two of their three wars. Talks on the region broke down in September.

"Kashmir is the core issue. The sooner it is resolved, it is better for the two countries," he said.

It also was the first meeting between the two leaders since Vaj-pay-ee's Hindu nationalist government took office in March, pledging to step up the fight against Kashmir insurgents. India claims Pakistan backs the Muslim separatists there.

Pakistan denies active involvement but gives diplomatic and political support to the militants.

Earlier, Sharif and Vajpayee sounded conciliatory as they spoke at the summit inauguration of the South Asia Association for Regional Cooperation.

"The inescapable reality that confronts us today is that South Asia is now nuclearized," said Sharif. "It is for us to steer away from the gathering storm."

Sharif suggested a resumption of talks in his speech, and the agreement was tied up during the private meeting.

The Indian leader said his talks with Sharif were "wide ranging and covered many issues, including Kashmir and terrorism."

Asked if there was any discussion of future nuclear testing, Vajpayee said: "Both India and Pakistan have already declared a mor-a-to-rium."

India has said it will not give up its own right to develop nuclear weapons unless all other countries do.