Britain's Prime Minister Theresa May leaves 10 Downing Street. Picture: Kirsty Wigglesworth/AP

London - A man accused of plotting to kill British Prime Minister Theresa May will go on trial next June for five weeks, a London court said on Wednesday.

Naa'imur Rahman, 20, of north London, is accused of planning to detonate an explosive device at the gates of Downing Street to gain access to May's office and kill her in the ensuing chaos.

He appeared at London's Old Bailey central criminal court, charged with preparing to commit acts of terrorism.

The charge sheet against Rahman said he was accused of conducting reconnaissance of the target location, buying a rucksack and delivering it and a bag to be fitted with an improvised explosive device.

These preparations were aimed at "committing attacks against persons in the United Kingdom", the charge sheet said.

Rahman is also accused of helping another man, 21-year-old Mohammad Imran, to join the Islamic State militant group by recording and sending him a sponsorship video.

Imran faces a charge of preparing terrorist acts, namely planning to travel to Libya to join Islamic State, possessing the sponsorship video made by Rahman, conducting research into travel options and having terrorist publications.

He is accused of having downloaded "How to survive in the West - a Mujahid's guide 2015" and having put some of its instructions into effect.

Rahman said he was British-Bangladeshi, while Imran said he was British.

Both were remanded in custody and will next appear in court on May 4 to enter their pleas.