
Ednane Mahmood denies attempting to travel to Syria to commit acts of terrorism for so-called Islamic State (IS).
A student accused of terrorism offences told a jury he felt "lost" and alone as he got near the Syrian border.
Ednane Mahmood, 19, from Blackburn, said he became "stranded" on the Turkish side of the border, alone, upset and running out of money.
He denies attempting to travel to Syria to commit acts of terrorism and providing internet links to others which encourage acts of terrorism.
Manchester Crown Court heard his family begged him to return.
Mr Mahmood told the jury: "I did not know what to do. I was lost. My planning was not good."
He is alleged to have downloaded videos showing of the beheading of British aid worker David Haines, before fleeing from his home during the early hours to travel to Syria on 18 September last year.
He left without telling his parents or siblings and took little money and few possessions, the court heard.
'Death or victory'
Prosecutor Mr Julian Evans said an examination of the laptop recovered from his family home showed Mr Mahmood posted links to Isis videos showing militants shooting soldiers and showing suicide bombers.
He did not manage to cross the border to Syria and on 20 September he was persuaded by his brother using Twitter to come back to the UK.
In one message to his brother, he quoted part of the Koran, which said: "Fight in the way of Allah, be it slain or victorious."
But he told the jury: "It doesn't mean fight, it means help women and children, who are oppressed and mistreated."
He arrived back in the UK on 24 September to resume his degree in Arabic at the University of Central Lancashire.
The trial continues.