Fox News senior judicial analyst Andrew Napolitano said Thursday that a federal judge sent a strong message with a four-year sentence handed down to a former Capitol Hill aide for a "doxxing" scheme against Republican senators.

The former aide to New Hampshire Democrat Sen. Maggie Hassan was sentenced to four years in prison Wednesday for publishing on Wikipedia the personal information of several Republican senators amid the bitter 2018 battle over the confirmation of Associate Justice Brett Kavanaugh.

A second aide is facing federal charges, accused of helping 27-year-old Jackson A. Cosko "wipe down" Senate computers he had hacked.

The aide, Samantha Deforest Davis, was a staff assistant in Hassan’s office from August 2017 until last December. She was fired after Capitol Police discovered her possible involvement in the scheme.

MARYLAND DEMOCRAT CALLS ON ACTIVISTS TO 'DOX' GUN-RIGHTS SUPPORTERS

MEGHAN MCCAIN HAS TENSE MOMENT WITH WHOOPI GOLDBERG ON 'THE VIEW'

Among the officials Cosko targeted were five Republican senators, including Senate Majority Leader Mitch McConnell of Kentucky. Cosko posted the home addresses and phone numbers of GOP Sens. Lindsey Graham of South Carolina, Mike Lee of Utah and Rand Paul of Kentucky, as well as then-Sen. Orrin Hatch of Utah.

Napolitano responded on "Fox & Friends" by saying the sentence may seem unusually harsh at first, but the defendants committed a "material interference with the function of the government."

"I think the sentence was appropriate. It seems harsh for doxxing, but this message has to be sent to people," he argued, questioning whether others knew about it or were involved.

"It appears that Senator Hassan knew nothing about it. Should she have known?" he asked, arguing the low-level staffers should not have had such access to congressional computer systems.

CLICK HERE TO GET THE FOX NEWS APP

All in all, the judge said the left's efforts to block Kavanaugh's confirmation "were unlike anything we have seen" and showed the bitter divide that exists between the two parties.

"The hatred is palpable."

Fox News' Gregg Re contributed to this report.