President Donald Trump appears to have violated Twitter's user guidelines with a recent tweet about North Korea. The company doesn't plan to punish him for it, and now it's trying to explain why.

Over the weekend, Trump tweeted a message about North Korea and dictator Kim Jong-un that included a thinly veiled threat. Threats are against Twitter's user guidelines, which forbid tweets that include "threats of violence or promote violence, including threatening or promoting terrorism."

"Just heard Foreign Minister of North Korea speak at U.N.," Trump tweeted. "If he echoes thoughts of Little Rocket Man, they won't be around much longer!"

Donald J. Trump: Just heard Foreign Minister of North Korea speak at U.N. If he echoes thoughts of Little Rocket Man, they won't be around much longer!

North Korea took the "won't be around much longer" part of the tweet as a threat, claiming on Monday that Trump's post was a "clear declaration of war."

Some wondered on Monday why Twitter hadn't removed the tweet — violating the company's rules usually means the tweet is removed and the account is suspended.

In a somewhat confusing post on Monday, the company shed some light on why the tweet was allowed to stay up.

Twitter's explanation: Because it was newsworthy.

"We hold all accounts to the same Rules, and consider a number of factors when assessing whether Tweets violate our Rules," the company wrote in a post. "Among the considerations is 'newsworthiness' and whether a Tweet is of public interest. This has long been internal policy and we'll soon update our public-facing rules to reflect it. We need to do better on this, and will."

Twitter PublicPolicy: We hold all accounts to the same Rules, and consider a number of factors when assessing whether Tweets violate our Rules 2/6

Twitter PublicPolicy: Among the considerations is "newsworthiness" and whether a Tweet is of public interest 3/6

A company spokesperson clarified to Recode that Twitter's post was not confirming that Trump's tweet violated its rules. Just that "newsworthiness" is one factor that is used internally to determine whether or not to take something down.

This won't sit well with a lot of people. Trump routinely walks the line when it comes to Twitter's abuse and safety rules, and given that newsworthiness is a consideration in how to respond, it's tough to imagine a scenario in which he might cross the line. As the president, everything he tweets is newsworthy.

Twitter has never acknowledged publicly that Trump has violated any of its guidelines — it rarely even acknowledges Trump's tweets. Back in July, for example, Twitter's VP of Trust and Safety, when asked about Trump, told a group of reporters that, "The rules are the rules, we enforce them the same way for everybody."

CEO Jack Dorsey has long defended Trump's tweeting. "I believe it's really important to have these conversations out in the open, rather than have them behind closed doors," he said in May.

—By Kurt Wagner, Re/code.net.

CNBC's parent NBCUniversal is an investor in Recode's parent Vox, and the companies have a content-sharing arrangement.