Indian Border Security Force personnel walk along a fence at the India-Pakistan border on the outskirts of Amritsar, India, on Wednesday. (Narinder Nanu/AFP/Getty Images)

NEW DELHI — As hostilities escalate between India and Pakistan, the world is getting a taste of what a limited war between two nuclear-armed rivals might look like.

Both countries are aware of the risks. On Wednesday, Pakistani Prime Minister Imran Khan explicitly referred to both countries’ nuclear arsenals.

“From here, it is imperative that we use our heads and act with wisdom,” Khan said. “I ask India: With the weapons you have and the weapons we have, can we really afford such a miscalculation?”

Since 1998, when India and Pakistan conducted tit-for-tat nuclear tests, both have worked to enlarge their arsenals — though their stockpiles remain smaller than those of countries such as France and China.

At the beginning of 2017, India had an estimated 130 nuclear warheads, up from 110 the previous year, according to the Stockholm International Peace Research Institute.

India has what is known as a full nuclear “triad” — the ability to deliver nuclear bombs from the ground, air and sea. Its ground-based ballistic missile, the Agni-III, has an approximate range of 2,000 miles. Its cruise missile — called BrahMos, developed jointly with Russia — can be launched from land, sea or air. Indian air force fighter jets have been modified to deliver nuclear bombs. India also has a 6,000-ton indigenously developed ballistic-missile submarine called the Arihant.

Although Pakistan is a much smaller country, it has a slightly larger arsenal — although it has less capacity than India to deliver such weapons. Pakistan had approximately 140 nuclear warheads in 2017, up from 120 to 130 a year earlier.

Unlike India, Pakistan’s ballistic-missile range is only 1,200 miles, although there are powerful versions under development. It has no nuclear-equipped submarines.

However, Pakistan has more plutonium-production reactors than India and the capability to produce up to 20 nuclear warheads per year. The country’s defense expenditure was more than 16 percent of national expenditures in 2017, far higher than India’s 9 percent.

Experts say that Pakistan’s focus on developing short-range nuclear-capable missiles is part of a tactical mission to be able to counter India’s superior strength in ground-based armed forces.

At the height of the U.S.-Iran nuclear deal negotiations in 2015, a New York Times editorial said the “biggest concern” was that Pakistan had the “world’s fastest-growing nuclear arsenal.”

Neither country is a signatory to the Non-Proliferation Treaty of 1968, which seeks to prevent countries from developing nuclear weapons. The United States, China, Britain, France and Russia are the five declared nuclear-weapons states under the treaty — those that have built and tested nuclear explosives before 1967.

Over the years, India has maintained a nuclear no-first-use policy, stating that the country will not be the first to initiate a nuclear strike and that its weapons would be used only for retaliation. But the recent expansion of its arsenal has signaled a possible shift in this doctrine.

Bharat Karnad, an Indian national security expert, has said that India’s doctrine could function differently in reality than on paper. In case of a contingency, weapons would be launched on “warning” — that is, on the detection of a signal from Pakistan, for instance — or “launched on launch,” if the other side were to initiate a nuclear strike.

Pakistan’s policy has emphasized “full-spectrum deterrence,” which essentially means competing with India to “deter the kind of activities we have seen over the last few days,” said Toby Dalton, co-director of the Nuclear Policy Program at the Carnegie Endowment for International Peace.

For security experts, the current clash between India and Pakistan is fascinating, if alarming. “This is like reality is playing out and testing deterrence theory,” said C. Uday Bhaskar, director of the Society for Policy Studies and a security expert in New Delhi.

Dalton expressed concern that domestic political considerations may tempt leaders to escalate the crisis. “The probability may be 1 percent, but the consequences are so terrible,” he said.