WASHINGTON — A former staffer of Sen. Maggie Hassan, D-N.H., will likely face at least two years in federal prison after pleading guilty to five felonies stemming from multiple burglaries into Hassan’s office last year.

Jackson Cosko, 27, admitted in plea documents that he had hacked into Hassan’s office computers so he could post private information about Republican senators during the hearings on Supreme Court Justice Brett Kavanaugh’s nomination.

The New Hampshire Union Leader also confirmed a female working in Hassan’s office at the time gave Cosko keys to get into that office to carry out his crimes.

After a different Hassan staffer spotted Cosko there without permission on Oct. 2, the accomplice staffer agreed to try to scrub office computers of Cosko’s criminal activity, according to court documents.

In a statement, Hassan praised federal prosecutors and the Capitol Police who investigated these crimes following Cosko’s arrest last fall.

“I am grateful to Capitol Police for all that they do every day to keep us safe, and I thank Capitol Police and the U.S. Attorney’s office for their work to bring this individual to justice for the crimes he committed,” Hassan said.

As for the accomplice staffer, identified in federal documents as “Subject A,” a Hassan spokesman said she was fired as soon as Hassan learned about her role in the scheme.

“We became aware of this individual’s involvement shortly after Cosko’s arrest. As soon as we were aware, the individual was removed from our office and ultimately fired,” said Communications Director Aaron Jacobs.

Hassan’s office declined to identify the staffer.

Cosko pleaded to two counts of making public restricted personal information, one count of computer fraud, one count of witness tampering and one count of obstruction of justice.

Under federal sentencing guidelines, Cosko could face a prison term from 30 to 57 months, the precise length is to be determined by U.S. District Court Senior Judge Thomas F. Hogan.

The plea deal requires that Cosko to forfeit to the federal government computer properties including an iPad, scan disks, a cellphone and two laptops.

Cosko’s sentencing is set for June 13.

The plea agreement states his lawyers can seek the low range of that jail term but Cosko cannot oppose any sentence of up to two years in federal prison.

Cosko’s lawyer said drug abuse led him to his computer crime spree.

“Mr. Cosko takes full responsibility for his actions and is sincerely remorseful,” Brian W. Stolarz said in a statement Friday.

“Sadly, Mr. Cosko’s ongoing struggle with drugs contributed to a regrettable course of conduct. He is committed to rehabilitating his life, his reputation, and addressing his addiction.”

Much of this case revolved around Cosko becoming enraged over the Kavanaugh hearings and posting private personal information onto the Wikipedia biographies of three GOP senators, Sen. Lindsey Graham of South Carolina, Mike Lee of Utah and Orrin Hatch of Utah.

Acting U.S. Attorney Alessio D. Evangelista said when Sen. Rand Paul, R-Ky., called for an investigation, Cosko responded by doxxing both Paul and Senate Majority Leader Mitch McConnell.

“He dares call for an investigation of ME?!?!?!...I am the Golden God!....Also it’s my legal right as an American to post his information...We are malicious and hostile...Send us bitcoins...Wednesday night will be the doxxed next,” Cosko wrote in a text message, according to court documents.

The following day, Oct. 2, Cosko broke into Hassan’s office and was discovered by the Hassan staffer.

He fled from the scene and later threatened that staffer, saying he would “leak it all” if his acts are reported to authorities.

The next morning Cosko met with the Hassan accomplice staffer and asked her to “wipe down” computers he had used and unplug them to erase recent activity.

Later that morning the Hassan staffer said she wasn’t able to finish the job.

“Hey I was able to wipe down the keys and mouse but (Witness 3) was coming so I could (not) do the other thing,” she texted Cosko, according to federal documents.

Court files say Cosko’s privacy invasion went beyond intimidating GOP senators after he used a “keylogger” hack to steal the passwords and usernames of six Hassan staffers without their knowledge.

He went on to download for his use “tens of thousands of emails and internal documents belonging to Senator Hassan’s office,” according to court documents.

“The defendant engaged in an extraordinarily extensive data-theft scheme, copying entire network drives, sorting and organizing sensitive data, and exploring ways to use that data to his benefit,” U.S. Attorney Evangelista said in court filings.

Cosko worked for Hassan from January 2017 until May 2018 as a legislative correspondent/systems administrator, and Hassan staffers said he was fired for his “failure to follow procedures.”

“The defendant was angry about his termination and concerned that it would have an adverse impact on his prospects for future employment. As a result, beginning no later than July 2018 and continuing until October 2018, the defendant engaged in an extensive computer fraud and data theft scheme that he carried out by repeatedly burglarizing Senator Hassan’s office,” prosecutors said.

When Cosko was arrested, he was working as an intern in the office of Rep. Sheila Jackson Lee, D-Texas. He was fired from Lee’s office after his arrest.