A plot to bomb a Westfield shopping center and London’s Underground network was halted mere weeks before the tenth anniversary of the 7/7 attacks, a court heard on Tuesday.

Mohammed Rehman, 25, was tracked down by counter-terror officers after asking his Twitter followers which of the two locations he should attack.

Rehman and his wife Sana Ahmed Khan, 24, were both arrested in May and charged with preparing acts of terror.

Opening the trial on Tuesday, prosecutor Tony Badenoch QC told jurors “substantial quantities of chemicals and bomb-making wherewithal” were recovered from Rehman’s home when the couple were arrested.

Khan helped to purchase the chemicals knowing they were to be used to make a bomb, the jurors were told.

The couple had developed a mutual interest in extreme Islamic ideology. Officers found they had repeatedly researched the 7/7 bombers, the court heard.

Rehman’s online research suggests he “wished to play his own part” in the London bombings that killed 52 people on the capital’s transport network in 2005.

The couple who wanted to bomb Westfield only caught because one talked about it on Twitter. We really are only stopping the dumb ones. — Katabasis (@Kata_basis) November 17, 2015

He allegedly shared a tweet on May 12 using the handle ‘Silent Bomber’ with a profile picture of ‘Jihadi John’ (the Islamist militant, real name Mohammed Emwazi) saying: “Westfield shopping center or London underground? Any advice would be appreciated greatly.”

On the same day, he researched the uncensored Al Qaeda press statement relating to the 7/7 attack, the court heard.

“He knew all about [London bomber] Shehzad Tanweer, as did his wife,” the prosecutor said.

The couple were arrested 16 days later.

“The evidence suggests that the London Underground may well have been on his mind as a potential target as he was particularly fixated with the events of 7/7 and he referred to Shehzad Tanweer, one of the 7/7 suicide bombers, as his ‘beloved predecessor,’” the prosecutor added.

Rehman, of Radstock Road, Reading, and Khan of Hutton Close, Reading, deny the charges.

The trial continues.