Joseph Hilton Dierks, 34, of Waterloo, Iowa, sent several threatening tweets last August, authorities said.

An Iowa man was sentenced Wednesday to six years in a federal prison for posting threatening Twitter messages directed at U.S. Sen. Joni Ernst.

Joseph Hilton Dierks, 34, of Waterloo, sent Ernst several threatening tweets in August, including one that suggested he would shoot her, authorities said. That message included a link to a 2010 movie in which a man fatally shoots a woman in the head.

After the tweet was posted, U.S. Capitol Police contacted the Waterloo police, and officers sent to Dierks’ home said he promised to “tone it down.”

State Sen. Joni Ernst speaks to supporters at a primary election night rally after winning the Republican nomination for...