A Wisconsin fugitive wanted on child sexual assault and child pornography charges hid out for more than three years in a makeshift bunker powered by solar panels and a pedal generator before a hunter found him, police said.

WSAW-TV reports that several months ago Thomas Nelson of Wausau found a bunker with a log door carved into an embankment on state land in the township of Ringle west of Wausau, about 145 miles (233 kilometres) north of Madison, the state capital.

Mr Nelson became curious and returned to the bunker on Friday morning to see what was inside.

The door was unlatched so he went inside.

He discovered 44-year-old Jeremiah Button, who disappeared in February 2016 just weeks before he was scheduled to stand trial on child sexual assault and child pornography charges.

Mr Nelson said: “I pushed the door open, and I look inside and I can see canned foods, there’s little storage boxes, and I’m like … I gotta go in.”

“I come around the corner a bit and there he is, laying in his bed. I mean, I was shaking when I went in, I was shaking when I went out.”

He moved away and called police, guiding them to the bunker’s door. A 20-minute stand-off ensued before Button surrendered.

Marathon County sheriff’s deputy Matt Kecker said Button seemed almost glad for human interaction.

Mr Kecker said Button told deputies that he had been building the bunker while his case was moving through court, stockpiling it with items he found in the Marathon County landfill.

Sheriff’s lieutenant Jeff Stefonek said Button set up solar panels on the bunker’s roof to power LED lights, radios, cooling fans and electronic equipment.

He also had a pedal-powered generator for cloudy days.

The bunker was small enough that it stayed warm in winter and cool in summer.

Mr Stefonek said: “He was not only surviving, but thriving in this structure through all of the different supplies he was able to find.”

Button is back in custody and is due back in court for a pretrial conference on September 16.

His attorneys, public defenders Anne Renc and Jessica Phelps, didn’t immediately return phone messages on Wednesday. Court records show they were assigned to Button’s case on Tuesday.

His attorney in 2016, Gary Kryshak, withdrew from the case in February 2017, a year after Button fled. He didn’t immediately return a message left at his office on Wednesday.