The U.S. passed a secret warning to Russia earlier this month of a plot to target large crowds ahead of an attack that killed at least 60 people and injured over 145 at a concert hall outside of Moscow, according to U.S. officials.

Explosions rocked the site and gunmen opened fire on concertgoers Friday evening, Russian authorities said, less than a week after Vladimir Putin was elected for a sixth term as the country’s president.

U.S. officials said they believed Islamic State was responsible for the attack. The group claimed responsibility in a statement issued by the Islamic State-affiliated news agency Amaq on Telegram, without providing evidence.

On March 7, the U.S. Embassy in Moscow issued a cryptic warning to American citizens to avoid concert venues. The U.S. had information about a planned terrorist attack in Moscow potentially targeting large gatherings—including concerts—which prompted the State Department to issue a public advisory, White House National Security Council spokeswoman Adrienne Watson said in a statement Friday night. “The U.S. government also shared this information with Russian authorities in accordance with its longstanding ‘duty to warn’ policy,” Watson added.

This week, Russian state news agency TASS said Putin described U.S. warnings about a possible terrorist attack as “provocative” statements that resemble “outright blackmail and an intention to intimidate and destabilize our society.” He called on the Federal Security Service and other law-enforcement bodies to step up efforts at preventing terrorist attacks.

The warning to Moscow was conveyed in line with a longstanding “duty to warn” policy that has been implemented across U.S. administrations to warn foreign governments against potential deadly threats. The intelligence was considered “actionable,” potentially providing Russian authorities with enough time to mitigate an attack, officials said.

One of the U.S. officials said the warning resulted from a flow of compelling intelligence in recent months. “We have basically a steady stream of intelligence dating back to November about ISIS wanting to strike within Russia,” the official said, referring to Islamic State.

Under the duty-to-warn policy, if U.S. spy agencies collect “credible and specific” information of an impending attack or kidnapping, they must warn the intended victims, whether they are U.S. citizens or not. The U.S. routinely shares warnings of potential terrorist activity with allies and partners. In some cases, it also warns potential adversaries.

Russia’s federal investigation agency said it was probing the incident as a terrorist attack, while the Federal Security Service said more than a hundred other people had been injured. Moscow Mayor Sergei Sobyanin called the events at the Crocus City Hall concert venue in Krasnogorsk, outside Moscow’s city limits, a “horrible tragedy.”

Weapons and ammunition were being confiscated from the scene for examination, investigators said early Saturday.

Video carried on Russian Telegram channels showed gunmen pacing across the theater’s bright foyer with people lying in pools of blood. Other videos showed people ducking, with the sound of gunfire in the background. The Wall Street Journal couldn’t independently confirm the footage.

TASS also reported an explosion at the venue, where it said part of the complex was engulfed in flames and black smoke was seen billowing into the sky. In a message posted on Telegram on Friday, Foreign Ministry spokeswoman Maria Zakharova said, “The entire world community is obliged to condemn this monstrous crime.”

Moscow has canceled all concerts and mass gatherings scheduled for the weekend, the mayor, Sobyanin, said. Two other regions close to Krasnogorsk also canceled events as Russia’s special operations teams, national guard and fire squads had been deployed to the theater complex, one of the Moscow area’s biggest venues.

Putin’s spokesman said the Russian leader was receiving constant updates and was coordinating the response to the attack, TASS reported.

Tickets for the concert, featuring art rock band Picnic and which was scheduled for 8 p.m. local time, had been sold out, according to ticket retailers, in a venue that had thousands of seats.

Witnesses told RIA Novosti that the attackers burst into the concert hall and began shooting people at point-blank range and throwing smoke bombs.

Video posted on social media showed people pushing each other out of the venue’s glass doors after the shooting died down. The musicians were unharmed, TASS reported. The fate of the gunmen couldn’t be immediately determined.

The shooting carries echoes of terrorist attacks on the capital by Chechen insurgents in the 2000s and undermines the image of invincibility Putin had sought to portray ahead of presidential elections earlier this week. The landslide victory has set him on a path to matching Stalin as Russia’s longest-serving leader.

The violence adds to a steady drip of security challenges Putin is facing as his invasion of Ukraine enters its third year. Specially-trained commando groups have been carrying out cross-border raids into the Belgorod region bordering Ukraine, in one case seizing control of a town as Russian authorities urged residents to evacuate. Ukraine’s government has denied direct involvement in the operations.

Putin has promised to use the full force of the law to suppress the incursions and punish those involved. Dmitry Medvedev, deputy chairman of Russia’s Security Council, said on Telegram that the terrorists he accused of carrying out the attack will be found and killed. “All of them should be caught and mercilessly eliminated,” he wrote. “Including the officials of governments that committed this crime.”

Kyiv denied any involvement. “Let’s be clear: Ukraine has absolutely no connection to this incident,” said Mykhaylo Podolyak , a senior adviser to Ukrainian President Volodymyr Zelensky . He warned on X that Moscow might use the attack as a reason to mobilize more troops and scale up the war in Ukraine.

People were being evacuated from the scene Friday evening, Russian state news agency TASS said, adding that the country’s national health institute had said some of the injured were being administered blood transfusions outside the venue.

The Health Ministry said dozens of ambulances had been dispatched to the scene. Appeals for blood were broadcast on state TV.

A woman carrying flowers walks near the Crocus City Hall concert venue following Friday’s deadly attack, outside Moscow, Russia, March 23, 2024. Sergei Vedyashkin/Moscow News Agency/Handout via REUTERS

Write to Ann M. Simmons at ann.simmons@wsj.com and Thomas Grove at thomas.grove@wsj.com