A defense attorney and an assistant district attorney took their case for Superior Court judge before District 3B voters and the defense won.

Josh Willey defeated Robert J. McAfee 39,451 to 36,901, or 51.67 percent to 48.33 percent, in the nonpartisan race for the judgeship, which is now held by Ken Crow, who is retiring.

District 3B covers Craven, Pamlico and Carteret counties.

McAfee, a prosecutor, and winner Willey, a New Bern trial attorney, are both Republicans.

“I’ve been humbled and really appreciative of all the work that so many folks did to help me get elected,” Willey said in a brief interview Tuesday night. “I compliment Robert on a race well run.”

He added that “Our district’s been lucky in the last several years, in that our judges have been really fine. I look forward to joining their ranks.”

Willey’s campaign was much better financed than McAfee’s effort. According to reports filed with the State Board of Elections, Willey’s campaign outraised his challenger’s by a factor of 4-to-1.

Through the end of the third quarter of 2016, Willey’s campaign had raised more than $48,169 from individuals. Willey also loaned his campaign $40,000 for the run, plus his campaign received a $750 donation from the not-for-profit Craven County Republican Men’s Club, reports show.

In contrast, McAfee’s campaign raised a little less than $21,000 through all of 2016, reports show.

A post on McAfee’s Facebook page stated: “The voters have spoken. Congratulations to Josh Willey for his victory in this race. I am proud of having remained competitive despite the obvious monetary advantage.”

Neither man had run for political office before.