BRIDGEWATER, N.J. — President Donald Trump and the publisher of The New York Times, A.G. Sulzberger, engaged in a fierce public clash Sunday over Trump’s threats against journalism, after Sulzberger said the president misrepresented a private meeting and Trump accused The Times and other papers of putting lives at risk with irresponsible reporting.

Trump said on Twitter that he and Sulzberger had discussed “the vast amounts of Fake News being put out by the media & how that Fake News has morphed into phrase, ‘Enemy of the People.’ Sad!”

In a five-paragraph statement issued two hours after the tweet, Sulzberger said he had accepted Trump’s invitation for the July 20 meeting mainly to raise his concerns about the president’s “deeply troubling anti-press rhetoric.”

“I told the president directly that I thought that his language was not just divisive but increasingly dangerous,” said Sulzberger, who became publisher of The Times on Jan. 1.

“I told him that although the phrase ‘fake news’ is untrue and harmful, I am far more concerned about his labeling journalists ‘the enemy of the people,'” Sulzberger continued. “I warned that this inflammatory language is contributing to a rise in threats against journalists and will lead to violence.”

This is particularly true overseas, Sulzberger said, where governments are using Trump’s words as a pretext to crack down on journalists. He said he warned the president that his attacks were “putting lives at risk” and “undermining the democratic ideals of our nation.”

Sulzberger’s lengthy, bluntly worded rebuttal was a striking rejoinder to the president by the 37-year-old publisher of a paper with which Trump has had a long, complicated relationship. And it apparently touched a nerve: The president fired off a series of angry tweets in the afternoon, accusing newspapers of being unpatriotic.

“I will not allow our great country to be sold out by anti-Trump haters in the dying newspaper industry,” he wrote. “The failing New York Times and the Amazon Washington Post do nothing but write bad stories even on very positive achievements — and they will never change!”

Trump, in his initial tweet from his golf club in Bedminster, New Jersey, on Sunday morning, described the meeting with Sulzberger as “very good and interesting.” But in referring to the phrase “enemy of the people,” he did not make clear that he himself began using that label about the press during his first year in office.

He has continued to assail the news media at rallies and even at more formal presidential events, encouraging his audiences to chant “CNN sucks!” and to vent their anger at the reporters assembled in the back.

Speaking to veterans in Kansas City, Missouri, last week, Trump said: “Stick with us. Don’t believe the crap you see from these people, the fake news.” As members of the crowd booed and hissed at the press corps, he added, “What you’re seeing and what you’re reading is not what’s happening.”

The president invited Sulzberger to the Oval Office earlier this month, according to The Times, continuing a tradition of meetings between presidents and the paper’s publishers. James Bennet, the editorial page editor of The Times, accompanied Sulzberger to the meeting.

In a statement, Mercedes Schlapp, a White House communications adviser, said, “The president regularly meets with members of the media, and we can confirm this meeting took place.” She did not provide any further details of the meeting or explain why the president chose to publicize it.

The White House had requested that the meeting be kept off the record, according to the statement from The Times.

“But with Mr. Trump’s tweet this morning,” the statement said, “he has put the meeting on the record, so A.G. has decided to respond to the president’s characterization of their conversation, based on detailed notes A.G. and James took.”

In a telephone interview, Sulzberger described the meeting with Trump, whom he had met only once before, as cordial. But he said he went into the Oval Office determined to make a point about what he views as the dangers of the president’s inflammatory language.

Sulzberger recalled telling Trump at one point that newspapers had begun posting armed guards outside their offices because of a rise in threats against journalists. The president, he said, expressed surprise that they did not already have armed guards.

At another point, Trump expressed pride in popularizing the phrase “fake news,” and said other countries had begun banning it. Sulzberger responded that those countries were dictatorships and that they were not banning “fake news” but rather independent scrutiny of their actions.

Still, Sulzberger said, by the end of the session, he felt that Trump had listened to his arguments. The president, Sulzberger recalled, told him he was glad that he had raised those issues and would think about them.

Sulzberger said he bore no illusions that his comments would prompt Trump to curb his attacks on the news media. He said he encouraged the president to complain about news coverage in The Times that he viewed as unfair. But he appealed to him not to systematically attack journalists and journalism around the world. Tensions between Times publishers and presidents are nothing new. Early in Bill Clinton’s presidency, Clinton complained to Sulzberger’s father, Arthur Ochs Sulzberger Jr., who was then publisher, about the paper’s editorials.

Sulzberger told the president he liked to think of them as “tough love,” according to Susan E. Tifft and Alex S. Jones, who wrote a history of the Sulzberger family.

“Well, just don’t forget the love part,” Clinton replied.

A decade later, Sulzberger and top editors of The Times were summoned to the Oval Office by President George W. Bush in an unsuccessful effort to prevent the paper from publishing a long-delayed article about the National Security Agency’s monitoring of phone calls without court-approved warrants.

“Generally speaking, presidents, in their dealings with newspaper publishers, have wanted to court them,” said Martha Joynt Kumar, a longtime expert in the relationship between the press and the White House. “They think if they bring the publishers in and explain their goals and intentions, that would be helpful.”

Trump regularly mocks “the failing New York Times,” but he has also visited its offices and spoken to its journalists. This weekend, The Times published an article about Trump’s daughter Ivanka and son-in-law, Jared Kushner, which noted that they had invited the younger Sulzberger to a dinner at their home in Manhattan in honor of Nikki R. Haley, the U.S. ambassador to the United Nations.