Berlin — The suspects in the foiled plot to attack Taylor Swift concerts in Vienna earlier this month sought to kill “tens of thousands” of fans before the CIA discovered intelligence that disrupted the planning and led to arrests, the agency’s deputy director said.

The CIA notified Austrian authorities of the scheme, which allegedly included links to the Islamic State group. The intelligence and subsequent arrests ultimately led to the cancellation of three sold-out Eras Tour shows, devastating fans who had traveled across the globe to see Swift in concert.

CIA Deputy Director David Cohen addressed the failed plot during the annual Intelligence and National Security Summit, held this week in Maryland.

“They were plotting to kill a huge number — tens of thousands of people at this concert, including I am sure many Americans — and were quite advanced in this,” Cohen said Wednesday. “The Austrians were able to make those arrests because the agency and our partners in the intelligence community provided them information about what this ISIS-connected group was planning to do.”

Austrian officials said the main suspect, a 19-year-old Austrian man, was inspired by the Islamic State group. He allegedly planned to attack outside the stadium, where upwards of 30,000 fans were expected to gather, with knives or homemade explosives. Another 65,000 fans were likely to be inside the venue. Investigators discovered chemical substances and technical devices during a raid of the suspect’s home.

Austria’s interior minister, Gerhard Karner, previously said help from other intelligence agencies was needed because Austrian investigators, unlike some foreign services, can’t legally monitor text messages.

The 19-year-old’s lawyer has said the allegations were “overacting at its best,” and contended Austrian authorities were “presenting this exaggeratedly” in order to get new surveillance powers.

Swift broke her silence about the cancellations last week after her London shows had concluded.

“Having our Vienna shows cancelled was devastating,” she wrote in a statement posted to Instagram. “The reason for the cancellations filled me with a new sense of fear, and a tremendous amount of guilt because so many people had planned on coming to those shows.”

She thanked authorities — “thanks to them, we were grieving concerts and not lives,” she wrote — and said she waited to speak until the European leg of her Eras Tour concluded to prioritize safety.

“Let me be very clear: I am not going to speak about something publicly if I think doing so might provoke those who would want to harm the fans who come to my shows,” she wrote.

Concert organizer Barracuda Music said it canceled the three-night Vienna run that would have begun Aug. 8 because the arrests made in connection to the conspiracy were too close to showtime.

The main suspect and a 17-year-old were taken into custody on Aug. 6, the day before the cancellations were announced. A third suspect, 18, was arrested Aug. 8. Their names have not been released in line with Austrian privacy rules.

The shows in London, the next stop after Vienna, came on the heels of a stabbing at a Swift-themed dance class that left three little girls dead in the U.K. In a statement issued after the Southport attack, Swift said she was “just completely in shock” and “at a complete loss for how to ever convey my sympathies to these families.” News outlets reported that Swift met with some of the survivors backstage in London.

The Vienna plot also drew comparisons to a 2017 attack by a suicide bomber at an Ariana Grande concert in Manchester, England, that killed 22 people. The bomb detonated at the end of Grande’s concert as thousands of young fans were leaving, becoming the deadliest extremist attack in the United Kingdom in recent years.

Cohen on Wednesday praised the CIA’s work in preventing the planned violence, saying that other counterterrorism “successes” in foiling plots typically go unheralded.

“I can tell you within my agency, and I’m sure in others, there were people who thought that was a really good day for Langley,” he said, referring to the CIA headquarters. “And not just the Swifties in my workforce.”

The record-smashing tour is on hiatus until the fall.