A 20-year-old man appeared in court on Wednesday accused of plotting to kill British Prime Minister Theresa May by first detonating an explosive device to get into her Downing Street office.

Naa‘imur Rahman, of north London, who described himself in court as Pakistani British, has been charged with preparing to commit acts of terrorism. He was remanded in custody after a brief appearance at Westminster Magistrates Court, Reuters reported.

Prosecutor Mark Carroll told the court Rahman planned to detonate an improvised explosive device at the gates of Downing Street and gain access to May’s office in the ensuing chaos and kill her.

“The secondary attack was to be carried out with a suicide vest, pepper spray and a knife,” he told the court.

Rahman was carrying two inert explosive devices when he was arrested last week, the court heard.

“His purpose was to attack, kill and cause explosions,” Carroll said.

Rahman appeared with a co-defendant, 21-year-old Mohammed Imran, from Birmingham, who is also charged with preparing to commit acts of terrorism. Imran said he was Bangladeshi British.

Carroll said Imran was accused of trying to join the Daesh terror group in Libya.

Rahman and Imran gave no indication as to their plea so a not guilty plea was entered on their behalf. There was no application for bail. The men will appear at London’s Old Bailey central criminal court on December 20.