Information provided by the CIA helped Russian security services foil an attack on St Petersburg's Kazan cathedral, US and Russian leaders say.
President Vladimir Putin phoned Donald Trump to thank him for the information, the White House and Kremlin confirmed.
The attack was allegedly planned to take place on Saturday, Russia says.
A White House statement said "terrorists" were captured prior to an attack "that could have killed large numbers of people".
Russia's FSB security service said in a statement on Friday that it had detained seven members of a cell of Islamic State supporters and seized a significant amount of explosives, weapons and extremist literature.
The cell was planning to carry out a suicide attack at a religious institution and kill citizens on Saturday, the FSB statement said (in Russian).
The group was preparing explosions targeting the cathedral and other public places in Russia's second city, the Kremlin statement said on Sunday.
Mr Putin told Mr Trump that Russia's special services would hand over information on terror threats to their US counterparts, it added.
Mr Putin had asked the US president to pass on his thanks to the CIA director and the operatives involved, both countries said.
A special counsel is investigating whether anyone from the Trump campaign colluded.
While Mr Trump categorically denies colluding with Russia, he has talked about the importance of working together "constructively".
Sunday's conversation between the two presidents marks the second time the two men have spoken in a week.
On Thursday they discussed North Korea and Mr Trump thanked Mr Putin "for acknowledging America's strong economic performance" in his annual press conference, according to the White House.
The White House said that the two leaders agreed in Sunday's phone call that the co-operation was "an example of the positive things that can occur when our countries work together".
An explosion on St Petersburg's metro system in April killed at least 13 people and is thought to be linked to jihadists.
Returning militants from Syria pose a real threat to Russia, the head of the FSB was quoted as saying on Tuesday.
Security services had already prevented 18 terrorist attacks in 2017, Alexander Bortnikov said in comments reported by Itar-Tass news agency.