India and China share a 2,100-mile border, which both countries have beefed up militarily in recent years. But the Agni 5 missile tested Thursday — Agni means fire in Hindi — would enable the Indian military, for the first time, to reach China’s most important cities, Beijing and Shanghai, with a nuclear attack.

“All of this, from the Chinese perspective, looks like a movement from balancing China to containing China,” said Graeme P. Herd, a security expert at the Geneva Center for Security Policy. He said the timing of the missile launching, as the Chinese government is reeling from a scandal involving a top leader, would heighten Chinese suspicions and also “increases the perception of an arms race, and the reality of an arms race, in East Asia, particularly between China and India.”

Prime Minister Manmohan Singh of India praised the scientists who developed the missile and called the launching “another milestone in our quest to add to the credibility of our security and preparedness and to continuously explore the frontiers of science.”

The United States, which led the criticism of North Korea’s missile launching last Friday, appeared to warily endorse the Indian missile test. “We urge all nuclear-capable states to exercise restraint regarding nuclear capabilities,” said Mark C. Toner, a State Department spokesman. “That said, India has a solid nonproliferation record,” he added, and noted that India had a “no first use” policy on nuclear weapons.

In Beijing, Liu Weimin, a Foreign Ministry spokesman, played down the test and described India and China as “not competitors but partners,” adding that the two countries should “work hard to uphold friendly strategic cooperation,” according to news agencies. CCTV, China’s state-run television network, questioned the accuracy of the Agni 5’s guidance systems and said the missile’s 50-ton weight would force it to be launched from a fixed location, making it an easy target.

India said the missile could be launched from a mobile platform, a claim that raised immediate concerns with India’s traditional rival, Pakistan, which is also a nuclear power.