LONDON — The leaders of an anti-Muslim extremist group in Britain have been found guilty of hate crimes and sentenced to prison, months after they drew international attention for helping President Trump get entangled in a diplomatic dispute with British leaders.

A judge in Folkestone Magistrates’ Court on Wednesday convicted Paul Golding, the leader of the group, Britain First, of one count of religiously aggravated harassment, and Jayda Fransen, the deputy leader, of three counts of the same offense. Mr. Golding was sentenced to 18 weeks in prison, and Ms. Fransen to 36 weeks.

The two were convicted over posting videos online of their harassment of Muslims in May 2017, at the same time as a trial of three Muslim men and a teenager who were accused and later convicted of raping a 16-year-old girl.

Britain First, estimated to have about 1,000 members, was little known outside the country until November, when Mr. Trump tweeted links to anti-immigrant and anti-Muslim videos made by the group, some of which were misleading.