The novelist Jennifer Egan has branded Donald Trump’s praise for a Republican who attacked a Guardian reporter “horrifying”, after the writers’ organisation PEN America filed a lawsuit against the president for violating the US constitution’s first amendment.

“It would be shocking at any time for the President of the United States to congratulate someone for an act of violence against a journalist,” Egan said, “but right now, in the context of the apparent Khashoggi murder, it’s frankly horrifying.”

Trump declared on Thursday night that Greg Gianforte, the Montana congressman who attacked the journalist Ben Jacobs, was “my guy”, only hours after admitting the consequences for the Saudi government would “have to be very severe” if they were found to be responsible for the murder of the journalist Jamal Khashoggi.

These latest developments are part of a pattern of behaviour which the writers’ organisation suggests has “hung a sword of Damocles” over journalists.

Egan is president of PEN America, which claims that while Trump is free to express critical views of journalists and writers, it is unconstitutional to use the powers of government to punish the press for its criticism.

PEN America’s lawsuit, filed in New York’s southern district court, argues that there have been multiple instances where critical coverage has resulted in reprisals. The suit cites the barring of CNN reporter Kaitlan Collins from a press conference “because Collins had earlier asked the president questions that the White House deemed ‘inappropriate’,” and press secretary Sarah Huckabee Sanders telling CNN’s Jim Acosta “that she would block him from having future access if he attempted during President Trump’s bill signing to ask the president a question about one of his tweets attacking Senator Kirsten Gillibrand”.

Other incidents cited include the department of justice’s antitrust enforcement action against the merger of CNN’s parent company Time Warner with AT&T, which it said came in the wake of “credible threats by the president to retaliate against CNN’s coverage of him and his administration”.

“President Trump has directed his threats and retaliatory actions at specific outlets whose content and viewpoints he views as hostile,” the complaint continues [PDF]. “As a result, journalists who report on the president or his administration reasonably believe they face a credible threat of government retaliation for carrying out the duties of their profession. President Trump has thus intentionally hung a sword of Damocles over the heads of countless writers, journalists and media entities.”

Egan, who won the Pulitzer for her novel A Visit from the Goon Squad, is the current president of PEN America, which is represented in this case by the non-profit Protect Democracy and the Yale Law School Media Freedom and Information Access Clinic. She said that Trump’s “threats and punitive actions … imperil our free press – one of the cornerstones of a healthy democracy”. The president, she has written in an essay for LitHub, is “famously prone to captious bluster”, with the press only one of his targets.

“This is not to say that routine public denigration by the president of the US has no impact. On the contrary, Trump’s repeated cries of ‘fake news’ have eroded faith in the press and smudged the distinction between truth and propaganda,” writes Egan. “None of that is why we’re suing. Trump’s speech – like that of every American – is protected by the first amendment. But the president has done more than vent against the press: he has threatened to use his presidential powers to stymie reporters and news organisations, and has followed through on those threats.”

According to Egan, US journalists have so far “responded bravely and vigorously” in their reporting on the Trump administration. But a recent survey of the members of PEN America found that “journalists are aware of the possibility of reprisals when they write negatively about the president”.

“That should never happen in America, where free speech was conceived of, according to Ben Franklin, as the ‘principal pillar’ of democracy. A leader with ‘the power to punish for words,’ Franklin wrote, ‘would be armed with a weapon the most destructive and terrible’,” wrote Egan. “Words are powerful weapons, too – as Trump’s efforts to quash them attest. In keeping with PEN America’s founding mission, we mean to stand together and show our strength.”