The man accused of the Parsons Green Tube bombing blamed Britain and America for the deaths of his parents in Iraq, the Old Bailey has heard.
College lecturer Kayte Cable said Ahmed Hassan told her it was “his duty to hate Britain” because of what happened to his family.
The court also heard he believed his father had been killed by US bombing.
Mr Hassan, 18, denies attempted murder and causing an explosion likely to endanger life.
He allegedly packed a bucket with 400g (14oz) of TATP explosives and shrapnel and left it on the District Line train on 15 September 2017.
It partially exploded causing a fireball to rip through a carriage during the morning rush hour, the Old Bailey has heard.
Iraqi Mr Hassan arrived in the UK as an asylum seeker in October 2015.
Ms Cable, a lecturer and mentor of his at Brooklands College in Weybridge, Surrey, said when he started there in April 2016 he was in “the worst state” she had seen a student.
She said he seemed “incredibly conflicted, frightened, confused”.
Ms Cable said she could remember Mr Hassan telling her “his father was blown up and his mother had been shot”.
She said he talked about Tony Blair and events in Iraq, adding: “I believe the anger was very clear. He referred to being angry several times.”
Ms Cable recalled an occasion in August 2016 when she saw a What’s App message on his phone which said: “IS has accepted your donation.”
On the same occasion, he allegedly told her: “It’s my duty to hate Britain.”
Ms Cable said Mr Hassan improved after finding a foster carer and was “very clever” – eventually being named student of the year in June 2017.
However, eight days before the bombing at Parsons Green, Ms Cable said she became “really concerned about his mental state” when she saw him at a restaurant in Kingston, south-west London, and he told her it was better to be in Iraq.
Then the day before the bombing, he came to see her bearing presents for children which she found “strange”.
The trial also heard from Barnardo’s worker Youseff Habibi, who got to know Mr Hassan when he was living in a children’s home in Surrey.
Asked about the defendant’s background, Mr Habibi told jurors: “His father was a taxi driver and one morning he went to work and a bomb fell on him and he died.
“And his mum died when he was much younger. He said ‘I don’t remember my mum.'”
Prosecutor Alison Morgan asked: “Did Mr Hassan ever say who he blamed for that?”
Mr Habibi replied: “America. He said it was American soldiers and American army bombing.”
The witness also said he once found Mr Hassan listening to an Arabic song on YouTube along the lines of “coming to the slaughter in your own home”.
The trial continues.