Prince Albert RCMP say a police gun went off accidentally while officers were trying to arrest two alleged car thieves — but no one was hurt.

It happened early Monday morning in a farmer's field where police had caught up with a car they had been pursuing for several kilometres in the rural municipality of Buckland near Prince Albert.

At around 1:30 a.m. CST, the car got stuck in a field, but when police told the occupants to get out, they refused, slamming the car into reverse and smashing into the police vehicle.

The officers then smashed out a window on the car and grabbed the two people inside.

While they were making the arrest, a police gun accidentally discharged, the RCMP said.

Nobody was hurt and there was no damage done, they said.

Earlier in the evening, police had been looking for two males who had allegedly stolen a car outside the city. There were reports that they had a firearm, the RCMP said.

Soon after, police found a car that had been driven into a ditch and abandoned.

Several hours later, they spotted the second car. They followed it on the highway and then onto the field.

Two 15-year-old boys have been charged with a series of offences, including attempted armed robbery, pointing a firearm, careless use of a firearm, uttering death threats, break and enter and theft over $5,000.

They're scheduled to appear in provincial court on Tuesday.