A Maryland man has been charged with making an online threat to kill a member of Congress from Texas, according to a court filing unsealed Wednesday.

Justin Kuchta, 39, of Annapolis, is charged with one count of interstate communication containing a threat to injure, a felony punishable by a maximum of five years in prison.

Kuchta was expected to make his initial court appearance Wednesday in Baltimore after surrendering to authorities earlier in the day.

DEMOCRAT CONGRESSMAN DEFENDS HIRING 87,000 NEW IRS AGENTS: 'IT'S IMPORTANT WE HAVE THE REVENUE STREAMS'

"You have the right to your own opinions, but not the right to threaten a federal official’s life," U.S. Attorney Erek Barron said in a statement.

Baltimore, Annapolis, Ocean City news

A man from Annapolis, Maryland, has been charged with threatening to kill a member of Congress from Texas.

A court filing does not name the member of Congress whom Kuchta is accused of threatening in a message that said the lawmaker "will be the first on the gallows." A staff member from the member's district office in Texas reported the threat to police in July.

FLORIDA GOP CONGRESSMAN AND FORMER GREEN BERET KICKS OFF SIX-FIGURE AD BUY HIGHLIGHTING AFGHANISTAN FALL

The Internet Protocol address used to send the message was registered to a private, high-speed network operated by the state of Maryland, according to a U.S. Capitol Police special agent's affidavit. When agents interviewed Kuchta at his Annapolis workplace, he admitted to sending the threatening message while he was working from home on his government-issued computer, the affidavit says.

The court filing does not identify Kuchta's government employer.

FORMER DEMOCRATIC CALIFORNIA CONGRESSMAN TJ COX INDICTED FOR MONEY LAUNDERING AND FRAUD

David Fischer, an attorney for Kuchta, declined to comment.