A 10-year-old boy surrendered to police Thursday after hiding out in a shed and firing a shotgun at them.

San Diego police said the unusual firefight began when the boy’s parents called the police because he was having an emotional and mental episode.

Police said the boy grabbed a hammer and a knife from his house. He initially spoke with police before running into a shed in his backyard, where a shotgun was stored, and began firing rounds off at police.

The San Diego Union Tribune reported gunshots kicked off a nearly two-hour standoff between the boy and San Diego police. Eventually SWAT officers and an armoured vehicle arrived on the scene.

During the stand-off, a nearby elementary school was put on lockdown and a home was evacuated.

The boy turned himself in to the police around 11.30am. Officers said the boy would be put in protective custody and given a mental health evaluation.

Lieutenant Shawn Takeuchi said the police responded to the situation like they would any other standoff, but assured that the police kept in consideration that they were dealing with a child.