NEW DELHI — Indian and Pakistani officials held their first bilateral meeting since an outbreak of hostilities last month that raised fears the two nuclear-armed neighbors could stumble into war.

After weeks of heightened tensions, officials from the two countries met Thursday for talks on a proposed road link from India to a major Sikh temple in Pakistan.

The shrine is one of the holiest sites for followers of the Sikh religion, and it sits less than three miles from the border between the two countries. India and Pakistan agreed in November to create a corridor to the temple to make it easier for Indian pilgrims to visit.

A joint statement following several hours of talks described the discussions as “detailed and constructive” and said the meeting unfolded in a “cordial environment.”

But India has emphasized that the meeting on the shrine, which is located in the Pakistani town of Kartarpur, does not represent a thaw between the two countries.

Raveesh Kumar, spokesman for India’s foreign ministry, said last week that the talks were not a resumption of bilateral dialogue but a sign of respect for “the emotions and sentiments of Indian citizens of Sikh faith.”

Tensions between India and Pakistan soared after a suicide bombing on Feb. 14 killed 40 Indian security personnel in the disputed region of Kashmir. Jaish-e-Muhammad, a Pakistan-based terrorist group, asserted responsibility for the attack, and on Feb. 26, India launched a retaliatory airstrike. Pakistan responded the next day, and the two countries engaged in their first aerial dogfight in decades.

Since the Feb. 14 attack, India has worked to isolate Pakistan through diplomacy. At India’s urging, the United States, France and Britain moved a proposal at the United Nations Security Council to designate Masood Azhar, the founder of Jaish-e-Muhammad, as a terrorist. On Wednesday, China, a staunch ally of Pakistan, blocked the move, saying it needed “enough time to study the matter.”

India’s decision to go ahead with the meeting on Kartarpur despite the bitterness of the past few weeks is partly a political calculation. Prime Minister Narendra Modi faces a competitive national election starting next month. His party is not in power in the state of Punjab, where two-thirds of India’s 21 million Sikhs reside. Access to the temple has been a long-standing demand of the community.

The corridor was viewed by both sides as a potentially positive confidence-building measure. Last year, when Pakistani Prime Minister Imran Khan laid the foundation stone for the road link, he sounded a hopeful note. “If France and Germany, who fought several wars, can live in peace, why not India and Pakistan?” he asked.

The two countries want to open the corridor before November, which will mark the 550th birth anniversary of Guru Nanak, the founder of Sikhism. Guru Nanak spent the last years of his life in Kartarpur.

Indian officials who were part of Thursday’s meeting said they requested that Pakistan provide visa-free access to pilgrims without any additional procedures. They also asked Pakistan to allow for 5,000 pilgrims every day, which would include not just Indians but people of Indian origin visiting from abroad.

Indian pilgrims to Kartarpur must obtain a visa from Pakistan before making a circuitous journey to the shrine. It includes traveling to the official border crossing 75 miles away followed by a two-hour bus ride to the temple. After the road is built, they may be able to walk the three miles to the shrine from India.

More than a dozen officials from both sides participated in the meeting, held at the Attari border crossing in Punjab. A photograph of the meeting shared with the media showed unsmiling officials from both sides seated across from one another separated by a row of plants.