But a gunbattle started by militants hours before Mr. Singh’s rare visit to the region underscored the fragility of the peace process.

India has not announced how many troops it will withdraw from the highly militarized frontier with Pakistan, but press reports have said only about 40,000 of a half million troops would be redeployed. The first contingent of at least 1,000 soldiers headed out yesterday from the Khanabal base camp, 35 miles south of the region’s main city Srinagar, an army officer said.

“We want a permanent end to violence,” Mr. Singh said in a speech to graduating doctors in Srinagar. “I am prepared to hold unconditional talks with anyone and everyone.”

India has cited a decline in separatist violence as the main reason for its troop withdrawal. But violence flared again yesterday, when suspected separatists lobbed grenades and fired at soldiers in Srinagar ahead of Mr. Singh’s visit.

Two suspected militants were killed, and two soldiers and a civilian were wounded in the attack, said K. Srinivasan, chief of the Border Security Force.

Kashmir is divided between the nuclear-armed neighbors with both claiming all of it. India accuses Pakistan of arming Muslim insurgents fighting for the region’s independence or merger with Islamic Pakistan. Islamabad denies it.

Talks with Kashmiri separatists began last year during the tenure of Mr. Singh’s predecessor, Atal Behari Vajpayee. But yesterday’s speech was a strong signal that the new government would press for an end to tensions with Pakistan and separatist Islamic militants.

“It is an important day in my life. I was waiting for this for a long time,” said Mr. Singh, who was given a standing ovation. “I have come here with the realization and hope that I can understand what your aspirations and desires are.”

The two-day visit, Mr. Singh’s first to the region since becoming prime minister in May, won praise among Kashmiris, many of whom feel disconnected from the rest of India and distrust the Indian establishment.

“For the first time, an Indian leader was not speaking to Pakistan. He was speaking to us,” said 45-year-old teacher Tariq Butt.

Mr. Singh is expected to announce a $1.5 billion economic-development plan for Kashmir, an aide to the prime minister said.

Although some separatists have begun talks with the government, many remain opposed to discussions. Separatists shut down much of Jammu-Kashmir state yesterday with a general strike, called to coincide with the prime minister’s visit and protest the central government’s control over the region. Only a few cars and motorcycles were on the roads, and most businesses were closed.