Ciaran Thomas Morris was arrested after the incident in the village of Cynwyd, near Corwen.
He admitted possessing a firearm with intent to cause fear of violence and affray via video link at Mold Crown Court.
Armed police and negotiators were deployed during the incident in March.
Morris was remanded in custody for sentencing on 5 May.
At the hearing on Friday, he pleaded guilty to possessing an air pistol with intent to cause fear of violence to a police officer and affray between 24 and 27 March.
Defending Morris, Simon Mills stressed that the air pistol was not a prohibited weapon which required a licence.
Prosecutor Emmalyne Downing said that the prosecution was not proceeding with charges of threatening to kill a police officer and damaging a police car.
Judge Philip Hughes warned Morris to expect a custodial sentence.
A 22-year-old man who was involved in an 11-hour armed standoff in a Denbighshire village has been warned he could be jailed.