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.