A neo-Nazi's plan to attack people with a machete at a gay pride event was foiled after he told others about it on Facebook, a court heard.
Police were tipped off about Ethan Stables' plan to attack the New Empire pub in Barrow, Leeds Crown Court heard.
The 20-year-old from Barrow denies preparing an act of terrorism and threats to kill.
Prosecutors said the "white supremacist" had a "deep-seated hatred" of minorities, especially gay people.
Prosecutor Jonathan Sandiford, who described Mr Stables, of Egerton Court, as a neo-Nazi who supported Adolf Hitler, said the defendant intended to "launch a murderous attack" on various communities.
The jury heard that over seven months, Mr Stables researched weapons, including how to make his own explosives and firearms.
Mr Sandiford continued: "On 23 June (2017), the defendant became aware that the New Empire public house was going to host an LGBT event, a pride night, and he was enraged by that.
"He began to take photographs, reconnaissance of that public house with a view to launching an attack later that evening."
Mr Stables allegedly told members of a Nazi-themed Facebook chat group he planned to murder people at the pub – but one woman in Staffordshire who spotted the messages was so concerned she contacted her local police.
Cumbria Police arrested Mr Stables close to the pub at about 22:00, the moment they said he was carrying out his last act of reconnaissance before intending to return later with weapons, the jury was told.
Detectives later found a machete, an explosive substance and Nazi regalia including a swastika armband in his flat, the court heard.
The trial is expected to last two weeks.