India and Pakistan agreed Sunday to set up a hotline between their foreign ministries to reduce the threat of accidental nuclear war, giving a small but helpful nudge to a nascent peace process that began with a meeting between their leaders in January.

The announcement came at the end of two days of talks on nuclear confidence-building measures. Delegates from the two sides, who described the atmosphere surrounding the talks as friendly, also agreed to continue a moratorium on nuclear testing, except in what they termed "extraordinary" circumstances.

India and Pakistan, neither of which is party to the nuclear Non-Proliferation Treaty, conducted tit-for-tat nuclear tests in 1998. The two countries have fought three wars since their simultaneous founding in 1947 and nearly did so again two years ago, alarming the world with the prospect of a nuclear exchange.

Next Sunday, the Indian and Pakistani foreign secretaries are scheduled to meet in New Delhi to consider ways of resolving their differences over Kashmir, the divided Himalayan province at the center of their 57-year conflict.

Although they remain far apart on the parameters of any settlement over Kashmir, each side emphasized the progress that had been made after a period of uncertainty following the installation of a new government in New Delhi last month.

"We are on track and we are on schedule," said a spokesman for the Pakistani Foreign Ministry, Masood Khan, who briefed reporters in New Delhi after the two teams of senior diplomats reached agreement Sunday. "There is progress. There's been a thaw."

In the recent elections, an alliance headed by India's Congress party unexpectedly ousted the coalition government of Prime Minister Atal Bihari Vajpayee, a longtime Hindu nationalist who -- after stepping back from the brink of war in 2002 -- made a priority of forging a lasting peace settlement with Pakistan.

In January, Vajpayee and Gen. Pervez Musharraf, Pakistan's president, agreed to begin formal peace negotiations after Musharraf pledged that Pakistan would not allow its territory to be used as a base for Islamic militants who have waged a 15-year insurgency against Indian forces in Kashmir.

The following month, foreign secretaries from the two countries agreed to a six-month schedule of negotiations on Kashmir and a variety of other subjects, including water and border issues, maritime boundaries and nuclear confidence-building measures, the topic of the meetings this weekend.

The Indian and Pakistani foreign ministers are supposed to meet in August to assess their overall progress.

Khan, the Pakistani spokesman, expressed hope Sunday that continued progress could lead to a summit between Musharraf and India's new prime minister, Manmohan Singh, an Oxford-educated economist and former finance minister who has a limited background in foreign policy.

In a joint statement Sunday, Indian and Pakistani officials said they had agreed to upgrade an existing hotline between the directors general of military operations in each country and that a new secure hotline "would be established between the two foreign secretaries . . . to prevent misunderstandings and reduce risks relevant to nuclear issues."

In addition, the statement said, "each side reaffirmed its unilateral moratorium on conducting further nuclear test explosions unless, in exercise of national sovereignty, it decides that extraordinary events have jeopardized its supreme interests." The two sides also agreed to pursue an agreement that would institutionalize procedures for giving notification of missile tests, something that is already done informally.

There was no apparent progress on broader strategic issues. India, for example, has declared a policy of "no first use" of nuclear weapons, and would like Pakistan to do the same. But Pakistani officials have so far declined to take such a step, citing India's overwhelming superiority in conventional forces. Indian officials, for their part, are less enthusiastic about Pakistani proposals for strategic restraint -- possibly to include caps on the size of each country's nuclear arsenals -- given the potential nuclear threat to India from China.

Khan said the two sides had discussed these broader questions "in a general sense," but that for now, the goals were more modest. "The spirit right now in the nuclear realm is to transcend beyond the rhetoric and do something substantive and concrete."

"There is progress. There has been a thaw," Pakistani Foreign Ministry spokesman Masood Khan said in New Delhi after two days of talks aimed at easing tensions between Pakistan and its nuclear rival, India.