A bumbling intruder broke into an empty New Zealand police station and accidentally locked himself in a cell, but managed to smash his way out again just before authorities arrived.

Sgt. Graham McGurk on Monday said the person broke into the deserted police station in the town of Matamata on North Island on Saturday night through the front office.

The intruder went to the cell bloc, and was accidentally locked in when a self-closing door clicked shut.

As police rushed to respond to an intruder alarm at the post, the intruder used a wooden chair that was inside the cell to smash through a window — supposedly outfitted with shatter-proof glass — to freedom.

Arriving officers could hear the intruder, but he fled through the front of the station as police were closing in from the back, McGurk said.

"It was quite unusual. The offender has almost done the job for us, getting himself locked in our cell," he said.

It wasn't known why the person broke into the police station, and nothing was stolen, McGurk said.