An Oklahoma man pleaded guilty on Wednesday to stalking and threatening a U.S. Representative from his state.

Keith Eisenberger, 39, of Bartlesville, Oklahoma, pleaded guilty to cyberstalking and threatening to kidnap and assault Rep. Kevin Hern, R-Okla., and threatening to kidnap and assault his spouse, the Justice Department said.

"The U.S. Attorney’s Office and our law enforcement partners will not tolerate online threats of violence meant to intimidate elected officials or members of our community. Keith Eisenberger now understands there are legal repercussions to committing these criminal acts," U.S. Attorney Clint Johnson said in a press release on Wednesday.

Hern represents Oklahoma’s first congressional district.

REP. HERN BILL WOULD TAX WIRE TRANSFERS OUT OF US TO FUND BORDER EFFORTS, TACKLE ILLEGAL IMMIGRATION

A photo of Rep. Kevin Hern with a microphone

Rep. Kevin Stern, R-Okla., speaks during a town hall event hosted by House Republicans on March 1, 2022 in Washington, DC.  (Samuel Corum/Getty Images)

In a statement, FBI Oklahoma City Special Agent in Charge Edward J. Gray clarified that the First Amendment does not protect individuals who threaten violence.

"While the First Amendment gives us the right to express our own opinions, it does not protect those who cross the line of making violent criminal threats," Gray said. "The FBI will continue to work closely with our law enforcement partners to ensure elected officials can perform the duties of their office safely."

46 HOUSE REPUBLICANS CALL ON MAYORKAS TO RESIGN OVER ‘COMPLETE FAILURE’ TO LEAD DHS

In the deal, Eisenberger admitted to sending "concerning statements" between Nov. 27, 2018, and May 11, 2022, including a message that said he was going to kidnap Hern and his wife, the Justice Department said.

A photo of Rep. Kevin Hern during a committee hearing

Rep. Kevin Hern, R-Okla., speaks during a House Small Business Committee hearing on July 17, 2020 in Washington, D.C.  (Erin Scott-Pool/Getty Images)

Eisenberger now faces up to a maximum felony sentence of 25 years in prison.

NYPD SHOOTS MAN WHO THREATENED TO KILL GOV. KATHY HOCHUL, POLICE COMMISSIONER: REPORT

The deal came amid a years-long investigation into Eisenberger, who frequented political events in his state to meet with lawmakers. The uninvited admiration then swiftly turned into harassment, the Justice Department said.

After Hern won the general election in 2018 and was sworn in in January 2019, Eisenberger traveled to Washington, D.C. to meet the lawmaker.

Rep. Kevin Hern exiting a car

Rep. Kevin Hern, R-Okla., arrives for the House Republican leadership elections at the Hyatt Regency on Capitol Hill on Tuesday, November 17, 2020.  (Tom Williams/CQ-Roll Call, Inc via Getty Images)

Once there, he demanded Hern resign. During the incident, Eisenberger reportedly told Capitol Police that he bought a one-way ticket and would not leave until Hern vacated his position.

In 2020, Eisenberger took to social media to call for Hern to be "federally executed." He also said Hern should face resignation, death or expulsion. In another post that same year, he threatened to assault the Republican lawmaker.

CLICK HERE TO GET THE FOX NEWS APP

The Justice Department also said Eisenberger continued his harassment in 2021, in a social media post where he threatened to kidnap Hern and his wife, Tammy Hern.

The FBI conducted the investigation and Assistant U.S. Attorney Christopher J. Nassar is prosecuting the case.