The court heard that Mr Khan is an Afghan national who arrived in the UK on a small boat in October 2024.
He had posted a number of videos charting his journey from Sweden where he had been since 2019.
On 12 October, Farage posted a five-minute YouTube clip which showed Mr Khan and his journey.
The court heard how Farage’s post had highlighted a Kalashnikov gun tattoo on Mr Khan’s face and described him as aggressive.
He also featured a video showing Mr Khan with a firearm and asked if it “was the kind of man we wanted in the UK?”.
The jury heard how a few days later Mr Khan posted a response, in which he demanded Farage delete his Youtube video.
He said he wanted to marry Farage’s sister, before making the gun gesture, saying “pop, pop, pop” and then headbutting his phone.
The trial continues.