The knife-wielding lunatic who slashed a man inside a London subway station had pictures of last week’s terrorist slaughter in California on his phone, authorities said on Monday.

Prosecutors claimed that suspect Muhyadin Mire, 29, also possessed pictures of carnage left behind by terrorist attacks in Paris last month and images of other ISIS-related activity on his mobile, according to CNN.

ISIS has applauded the killing of 14 people in San Bernardino last week, in an attack carried out by a husband-and-wife terror team.

Mire was charged with one count of attempted murder on Monday in Westminster Magistrates’ Court, stemming from Saturday’s attack at the Leytonstone Underground station.

“He was arrested and said he was doing this for his brothers in Syria, which he repeated whilst in custody,” prosecutor David Cawthorne told the court.

Mire, who wore a gray tracksuit, choked back tears. His only words in court were to confirm his name and address.

Judge Quentin Purdy ordered Mire held without bail, saying he’s a threat to the public.

“I am remanding you in custody as there is substantial grounds to believe you will not surrender to bail and may commit further offenses,” said Purdy, who also ordered a mental evaluation of the suspect.

“You also present a real danger to other members of the public and there appears to be an issue with your mental health.”

Mire was quickly arrested by police after attacking a 56-year-old man, who is expected to survive his knife wounds.

Witnesses said Mire shouted, “This is for Syria,” during the scary 7 p.m. assault.

Viral cellphone video, shot by a bystander, captured the moments after Mire’s arrest when a passer-by chastised the accused terrorist: “You ain’t no Muslim, bruv.”