In this still from a video, Russian Federal Security Service operatives detain a suspect in St. Petersburg. (Russian Federal Security Service via AP) (AP)

Russian President Vladimir Putin on Sunday phoned President Trump to thank him for a tip from the CIA that thwarted a terrorist attack being planned in St. Petersburg.

The unusual call — countries share intelligence all the time, but presidents rarely publicly thank one another for it — was confirmed by White House spokeswoman Sarah Huckabee Sanders.

Putin told Trump that the information provided by the CIA allowed Russian law enforcement agencies to track down and detain a group of suspects who were planning to bomb the centrally located Kazan Cathedral and other crowded parts of Russia's second-largest city.

"Based on the information the United States provided, Russian authorities were able to capture the terrorists just prior to an attack that could have killed large numbers of people," the White House said in its readout of the call. "Both leaders agreed that this serves as an example of the positive things that can occur when our countries work together."

It was the two presidents' second conversation since Thursday, when they spoke after Putin's annual four-hour televised news conference, during which the Russian leader mentioned the booming U.S. stock market as an example of Trump's successes. The White House said Trump thanked Putin for remarks he made "acknowledging America's strong economic performance."

[Putin blames Trump’s political opponents for poor U.S.-Russian relations]

Putin said he doubted Trump would be able to improve relations between their two countries because the U.S. president was being held back by his political opposition and allegations of Russian interference in the 2016 U.S. election were being invented to raise doubts about Trump's legitimacy.

The CIA tip apparently provided the breakthrough that allowed Russian authorities last week to detain seven members of what officials identified as Islamic State cells. The suspects, investigators said, had been planning a suicide bombing this weekend in Kazan Cathedral, a St. Petersburg landmark located on Nevsky Prospect, its main thoroughfare. The cathedral was built between 1801 and 1811, and, controversially at the time, was designed along the lines of a Roman Catholic basilica.

Russian state television reported the capture of the alleged cell members as it often does in takedowns of terrorist suspects, with a video that shows agents in action and an on-camera confession. In this case, a man identified as Yevgeny Yefimov confessed that he planned to carry out an attack in the city. Later, Yefimov told a St. Petersburg court that he was planning to target the Kazan Cathedral. Three more people were arrested Sunday in connection with the alleged plot, RIA Novosti reported.

The agency published a list of 17 major terrorist plots that Russian law enforcement has been able to head off this year.

The suspects in the latest arrests had been using the messaging app Telegram to communicate with Islamic State leaders abroad, according to law enforcement agencies. Telegram was fined last month for refusing to provide Russian security forces access to the online conversations of two suspects linked to a suicide bombing in April that killed 16 people and injured about 100.

[Russia’s aggressive response to the St. Petersburg subway bombing is raising questions]

In their phone conversation Sunday, Putin asked Trump to pass along his gratitude to CIA Director Mike Pompeo and the American intelligence agents who received the information, the Kremlin said. It said Putin also told Trump that "if Russian special services obtain any information on terrorist threats against the United States and its citizens, they will definitely and immediately pass it to American counterparts through partner channels."

The CIA declined to comment on that.

But the White House said that Trump "then called Director Pompeo to congratulate him, his very talented people, and the entire intelligence community on a job well done!"

Greg Miller and Phillip Rucker in Washington contributed to this report.

Read more:

On visit to Syria, Putin lauds victory over ISIS and announces withdrawals

Putin is outplaying Trump in the Middle East

Russia’s aggressive response to the St. Petersburg subway bombing raises questions

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news