Three men are in custody after a backroom scuffle in a small-town courthouse ended with a sheriff being shot in the hand and a short-lived escape in the officer’s vehicle.

The shooting took place just before noon on Tuesday in Whitecourt, Alta., where two local men were making their first court appearance after a drug bust last week.

An eyewitness said the disturbance began with what sounded like a fight in a hallway used to transport prisoners.

“You could hear behind the door where they keep prisoners to stand trial, you could hear there was a fight happening between whomever,” said Kathlene Campbell-Conlon, a reporter for radio station CFXW, who was in court to cover the appearances.

“An officer who was in the court at the time hopped the guardrail and ran behind the door,” she said. “The door shut, you heard more fights, you heard a couple of high-pitched screams, then two, maybe three gunshots.”

The impact of the shots, she said, knocked hangings off the wall inside the court. The immediate reaction among those in the room was panic. Everyone was pushing to get out and chairs were being thrown around, said Ms. Campbell-Conlon.

Once outside, she said bystanders tried to get help for the wounded officer.

“You [could] hear people saying, ‘You have to call 911! We have to get an ambulance! This officer needs medical attention!’”

Then she watched the suspects flee.

“As I walked toward the sounds of everything that’s happening, I saw a man climb into the passenger side of this sheriff’s van.

“You could hear people: ‘There’s a prisoner in there!’ We’re yelling this. Then they backed out and they drove south out of Whitecourt.”

Mayor Trevor Thain confirmed the prisoners escaped in the sheriff’s van. Mr. Thain said the two escapees were arrested at a farmhouse about 10 kilometres south of Whitecourt.

Mr. Thain said police detained a third man at the farmhouse.

“There’s a third man taken into custody, but we don’t know if he’s a suspect,” he said.

The sheriff, who RCMP say was part of the prisoner transport section, was taken to hospital. Officials with the union representing the sheriff said he will recover.

“I am relieved to hear reports that the provincial sheriff who was shot at work in Whitecourt will recover from his injury,” said Guy Smith, president of the Alberta Union of Provincial Employees.

Union Local 003 chair Clarke McChesney said the officer, whose name has not been released, will be able to return to work.

“No gunshot wound is trivial, but the outcome in this case could have been much worse,” said Mr. McChesney. “I am glad to know this member will be able to go home and come back to work again.”

Alberta’s sheriffs are armed law enforcement officers who come under the province’s Solicitor General. They support RCMP and municipal police officers in a variety of roles, including courthouse security and prisoner management and transportation.

Mr. Thain says the suspects were among those arrested in last week’s drug bust. Six people were charged after that raid, which turned up cocaine, methamphetamine and marijuana, as well as an illegal firearm.

Justice officials said the amounts of the drugs seized in the raid were small.