When Democratic legislator Scott Hamann posted a profanity-laden Facebook rant Tuesday suggesting that he would harm President Trump, he did the same thing Trump has justifiably been accused of doing: appealing to the worst impulses of the public.

Hamann’s written apology is not enough — in the best interest of civil discourse in Maine politics, the South Portland state representative should apologize on the House floor, disavow his implied threat and seriously consider resigning if he can’t convince the public that he is able to work collaboratively alongside people with whom he disagrees.

In the post in question, Hamann criticizes President Donald Trump at length and lashes out at congressional Republicans and the president’s supporters, wrapping things up by stating: “Trump is a half term president at most, especially if I ever get within 10 feet of that (vulgar term).”

We were appalled when then-candidate Donald Trump made a joke that insinuated that Hillary Clinton should be shot if she were elected to the White House. And Hamann, by suggesting that he would hurt President Trump if he got close enough, crosses the line in the exact same way. Violence isn’t how people in a civil society work out their differences with one another. Like it or not, we have to use our words, as a legislator should know — especially one who, like Hamann, is in his third term in office.

An experienced lawmaker also should have grasped that they’re in a spotlight that’s hard to escape. Elected officials have always been called to account for what they say by colleagues, constituents and journalists. In the age of social media, platforms like Facebook create a permanent record of later-regretted statements that millions of people can see just by tapping on their phones. And even though Hamann took down the incriminating post, it has lived on in the form of a screenshot made by the Maine Republican Party.

Hamann issued a prepared statement Wednesday, calling his screed an “aggressively sarcastic and inappropriate” statement that was “born out of frustration with the vile language surrounding politics” and “was intended to make a visceral point about the devolving political discourse in America.”

Well, he achieved part of his mission: The post did make people recoil. But rather than causing readers to reflect on our divisive dealings with one another, the rant not only encourages more division but also touts physical force as the way to deal with our fellow Americans when we’re tired of talking.

Hamann has done harm to what is left of Maine’s thin veil of political comity, which has been damaged by a bruising legislative session. The onus is now on him to make it right or resign.