LONDON — A British man accused of killing a worshiper and injuring several others when he rammed a van into a congregation of Muslims leaving a London mosque last year had been in contact with far-right groups before the attack, prosecutors said at his trial on Tuesday.

The BBC reported that the man, Darren Osborne, 48, had received a Twitter message from Jayda Fransen, the deputy leader of Britain First, a group that recently gained notoriety after President Trump recirculated unverified anti-Muslim videos it had posted online. Ms. Fransen was arrested in December on charges related to hate crimes.

Mr. Osborne, whom his former partner described as a “loner,” had also received an email from an account linked to the English Defence League, an extremist group that opposes what it claims to be the spread of Islam and Shariah law in Britain.

Officials say that Mr. Osborne plowed into a group of worshipers leaving the Finsbury Park Mosque in North London on June 19 during Ramadan, the holiest month in the Muslim calendar. One man was killed and at least 10 people were injured.