A former Democratic congressional staffer pleaded guilty Friday to federal charges after he posted leaked personal information about Republican senators on Wikipedia, then threatened a witness who caught him.

Jackson Cosko, 27, of the District of Columbia, pleaded guilty to five offenses related to his “doxing” the senators — uploading their personal information online — including computer fraud, making public restricted personal information, witness tampering and obstruction of justice.

Prosecutors said he went after the lawmakers after one senator fired him and he got upset with the others while watching testimony on sexual assault allegations during Supreme Court justice Brett Kavanaugh’s confirmation hearings.

His targets included GOP Senate Judiciary Committee members Lindsey Graham, Mike Lee and Orrin Hatch, as well as Mitch McConnell and Rand Paul.

He faces nearly five years in prison when he is sentenced June 13.