(CNN) A man who allegedly plotted to assassinate British Prime Minister Theresa May appeared in court Wednesday charged with terrorism offenses.

London based Naa'imur Zakariyah Rahman, 20, who described himself in court as Pakistani British, was arrested last week and charged on Tuesday.

A second man, Mohammed Aqib Imran, 21, from Birmingham, appeared in court at the same time, also charged with "the intention of committing acts of terrorism." When asked about his nationality in court, Imran said he was Bangladeshi British.

According to court documents, Rahman planned to detonate an explosive device at the gates of Downing Street and then seek to gain access to No. 10 -- May's official residence -- "in the ensuing chaos with a view to trying to kill the Prime Minister."

"The secondary attack on No. 10 was to be carried out with a suicide vest, pepper spray and a knife," the document said.