A man showed a beheading video to a child and said members of so-called Islamic State were not “bad people”, a court heard.
Zameer Ghumra, 38, from Leicester, is also alleged to have taught the child and one other how to “survive a bomb attack” and fight with knives.
Nottingham Crown Court heard the pharmacist, who denies committing a terrorist offence, “brainwashed” them.
The jury was told he said the boys were put up to making “a false allegation”.
Mr Ghumra, of Haringworth Road, is accused of disseminating “terrorist propaganda” in the form of a graphic Twitter video on his mobile phone, between January 2013 and September 2014.
Opening the case Simon Davis, prosecuting, said Mr Ghumra, who is said to have been setting up a Islamic religious school, tried to “radicalise” and “indoctrinate” the boys, telling them not to have non-Muslim friends.
“He showed them Islamic State training videos, that included how to behead somebody,” Mr Davis told the jury.
When he was asked by one child how anyone could do something so “disgusting”, the prosecutor said Mr Ghumra replied: “If you truly believe in Allah, you can do it.”
Mr Davis said the accused told the children: “I want you to persuade others to join Isis if you’re going to stay in the UK.”
He added Mr Ghumra told a pharmacy customer that IS are “not bad people – they’re only defending themselves”.
The prosecution told the court that, after Mr Ghumra’s arrest in September 2015, a computer was seized showing 1,600 search results for terms including “survival knives” and “bush-craft”.
However, neither the phone containing the beheading video or the video was recovered, the jury heard.
The continuing trial, which is due to last seven days, is expected to hear from the two boys.