A branch of the Islamic State claimed responsibility on Friday for the attack in Moscow that killed at least 60 people and injured about 100 others, and U.S. officials confirmed the claim shortly afterward.

The United States collected intelligence in March that Islamic State-Khorasan, known as ISIS-K, the branch of the group based in Afghanistan, had been planning an attack on Moscow, according to officials. ISIS members have been active in Russia, one U.S. official said.

After a period of relative quiet, the Islamic State has been trying to increase its external attacks, according to U.S. counterterrorism officials. Most of those plots in Europe have been thwarted, prompting assessments that the group had diminished capabilities.

“ISIS-K has been fixated on Russia for the past two years,” frequently criticizing President Vladimir V. Putin in its propaganda, said Colin P. Clarke, a counterterrorism analyst at the Soufan Group, a security consulting firm based in New York. “ISIS-K accuses the Kremlin of having Muslim blood in its hands, referencing Moscow’s interventions in Afghanistan, Chechnya and Syria.”

The attack on Friday in Moscow, like a January assault in Iran claimed by the group, could prompt a reassessment of its ability to strike outside its home territory.

In addition to publicly warning on March 7 about a possible attack, U.S. officials said they had privately told Russian officials about the intelligence pointing to an impending attack. It is not clear how much information the United States gave Russian officials beyond what was in the public warning.

American intelligence agencies have a “duty to warn” potential targets of dangers when they learn of them.

The United States had warned Iran of a possible attack ahead of twin bombings in January that killed scores and wounded hundreds of others at a memorial service for Iran’s former top general, Qassim Suleimani, who was killed by a U.S. drone strike four years before.

Western intelligence agencies had collected intelligence about possible planning by ISIS-K to bomb the service. As in Russia, ISIS-K claimed responsibility for that attack.