More than 50 English Defence League protesters tried to surround Calderdale Magistrates’ Court, as 25 men appeared charged with serious sex offences against two girls.
There were angry scenes outside the building as the group chanting abuse confronted police and people leaving court.
Punches were thrown and the crowd mobbed some of the defendants as they made their way from the hearing into the town centre.
The group of EDL supporters - which included teenagers - chased defendants down Harrison Road throwing punches, hurling abuse and trying to taking photographs of them.
The far-right group members then spilled out onto Fountain Street causing motorists to stop abruptly.
Other people in the group slammed on the windows and stood in front of the cars that drove the defendants away.
At one stage the mob attempted to break through a police cordon outside the court in Blackwall, Halifax.
During one of the skirmishes, a 36-year-old man was arrested on suspicion of committing a public order offence.
Last night, he was in police custody.
The public gallery had filled up earlier in the day, and police officers then sealed off the building during the hearing, which lasted more than three hours.
More than 40 officers lined the street and the road was closed. Extra police were drafted in to protect neighbouring businesses in the town centre.
Protesters started arriving at 9am yesterday (Thursday), including women and children, wearing hoods covering their faces and waving banners with EDL markings on. They were chanting “scum” and “nonce” almost continually.
The protest became more heated at around 11am when the defendants began to leave the court and protesters tried to reach them.
A police spokesperson said: “A comprehensive policing plan was in place to ensure that the people that live, work and visit Halifax were safe and felt safe.
“The town centre had an increased neighbourhood policing footprint. This included neighbourhood officers, PCSO’s, community wardens and two mounted officers.”
The 25 men faced charges including rape, sexual activity with a child under 16 and trafficking for the purposes of sexual exploitation.