Brusthom Ziamani, a 19-year-old from south east London is accused of planning to behead a British soldier.
He was arrested in the capital last August, on his way to carry out the attack, carrying a hammer and a knife wrapped in an Islamic flag.
Today the jury at the Old Bailey were read extracts of an interview with detectives, including the comments about David Cameron.
The teenager told police he would harm the Prime Minister, if he got the chance.
The jury heard Mr Ziamani posted on Facebook under the name Mujahid Karim.
On social media he supported Sharia law and stated that he was "willing to die in the cause of Allah".
Brusthom Ziamani is charged with preparing an act of terrorism on or before 20 August 2014, he denies this charge.