They’ve finally nailed him.

A screwball dubbed the “Nighttime Nailer” who police say has terrorized Oregon City over the last two years — by intentionally dumping nails onto local streets — has been busted.

Bret Michael Wilson, 56, was caught red-handed early Tuesday when undercover officers with the Oregon City Police Department saw Wilson tossing nails from his vehicle onto South Center Street, authorities announced.

When Wilson was stopped around 5:40 a.m., he “admitted to intentionally throwing nails onto the streets, not only in Oregon City but throughout the metropolitan area,” police said in a Facebook post.

Wilson told police he has hurled roofing nails roughly 50 times onto busy city streets over the last two years, according to authorities.

In the last week alone, Wilson, an Oregon City resident, has thrown nails onto several area roads between 5:40 a.m. and 5:50 a.m., police said.

Over the last couple of years, the nails were dropped onto Oregon streets primarily in the early morning hours when it was still dark outside, according to cops.

Police said the nails did cause damage to a number of motorists’ tires, but “luckily” no one was injured.

“We’ve been looking for him for a very long time,” Shaun Davis of the Oregon City Police Department said of Wilson, KATU reported. “He was super sporadic when he did it. It wasn’t super consistent.”

Wilson was arrested and booked at Oregon City’s Clackamas County Jail on four counts of disorderly conduct, police said.

Oregon City Mayor Dan Holladay announced the bust in a local Facebook group called Oregon City Chit Chat, writing, “I am happy to announce that the Nail Bandit has been caught,” according to KATU.