Police say Joshua McCoy learned the hard way that crime doesn’t pay. It can also hurt.

McCoy, 38, took a shotgun to a Portland, Ore., home on Monday night. He broke down the door, and then demanded money from the people inside, KPTV reports.

But he wasn’t counting on one thing: a 20-year-old man inside wasn’t going to be a robbery victim. Police say that 20-year-old fought back, grabbing McCoy’s shotgun and pushing him down a flight of stairs. That changed the scenario, making McCoy the one who needed medical attention, which he got as the home’s inhabitants kept guard over him before police arrived.

McCoy was taken to the hospital after briefly passing out. He was then arrested and taken to jail where he was booked on first-degree robbery, second-degree robbery and first-degree burglary.

That arrest produced this mug shot, which shows just how bad his apparent robbery attempt went:

Oregon man breaks into home with shotgun and gets beaten up by homeowner

Joshua McCoy (Source: Multnomah County Sheriff’s Office via KPTV)

It’s unclear why McCoy targeted the home, as the intended victims say they do not know him.

But one thing is clear: McCoy knows it hurts to be a criminal.