Donald Trump’s war with the US press began as an act in the absence of effective Democratic opposition then spiraled out of control, according to an eagerly awaited new book by one of the chief targets of the president’s fury.

In The Enemy of the People, CNN chief White House correspondent Jim Acosta writes that after an early confrontation, close Trump aide Hope Hicks called him to say the president wanted him to know he was “very professional today”.

“He said, ‘Jim gets it,’” Hicks is quoted as saying.

Trump, Acosta writes, had just called the reporter “fake news” and “very fake news” after being asked about Russian election interference at a press conference in February 2017.

“When he called us ‘fake news’,” Acosta writes, “it was, in his mind, an act.”

The incident occurred amid the opening shots in a rapidly escalating war that now sees fierce national debate over Trump’s attacks on mainstream media and what they mean for press safety and US democracy itself.

Acosta’s book, subtitled A Dangerous Time to Tell the Truth in America, will be published on 11 June. The Guardian obtained a copy.

Neutrality for the sake of neutrality doesn’t really serve us in the age of Trump

True to the style of Washington political reporting often complained about by Trump, Acosta mostly uses unnamed sources, many of whom are said to have spoken over social drinks. They are often blunt in their assessment of their boss. A “senior White House official” tells Acosta: “The president’s insane.” A “former White House national security official” says staffers were not sure the president had not been “compromised” by Russia.

At the start of Trump’s presidency, the White House was frustrated by anonymously sourced stories and what it saw as the antagonistic stance of mainstream outlets from CNN and NBC to the Washington Post and the New York Times. Because Republicans controlled Congress and Trump needed an enemy that could be presented as dangerous and effective, Acosta writes, the president decided to attack the media.

The notion that the media was the “enemy of the people” emerged swiftly and caused great consternation among a press corps spooked by virulent abuse at Trump rallies. Acosta cites three unnamed sources who say the controversial line of attack originated with Steve Bannon, then Trump’s chief White House adviser.

Acosta’s own White House hard pass was revoked in November 2018, after he questioned Trump about his claims of migrant “caravans” from central America; Acosta refused to give up the microphone when pressed by a White House staffer. The confrontation, in which Trump called Acosta “a rude, terrible person”, had been brewing for months.

In the run-up to the release of Acosta’s book, Trump-friendly media has been ramping up criticism of the CNN reporter.

This week, the Fox News website cited one unnamed CNN employee as saying: “Jim Acosta is, a lot of times, asking the right questions, but it doesn’t always need to be about him and his grandstanding. Acosta is supposed to be a correspondent reporting the facts but you can’t tell the difference between him and a paid pundit.”

In his book, Acosta admits to sometimes “grandstanding” and “showboating”. He also says he “opts for the bait” when questioning Trump, “which bothers some people”. Of concerns he may be biased against the president, he writes: “Neutrality for the sake of neutrality doesn’t really serve us in the age of Trump.”

Among events leading up to his expulsion from the White House, there are run-ins with Trump’s first press secretary, Sean Spicer, who is quoted as calling Acosta a “fucking weasel” and shown shouting abuse over a CNN caption. There follow bruising battles with Spicer’s successor, Sarah Sanders, whose approach to the job, including lying freely and cutting press briefings almost to zero, Acosta criticizes heavily – even though, he writes, “we had all been for drinks with her” and she could “throw back her Maker’s and Coke with the best of them”.

On the day he lost his hard White House pass, Acosta writes, “everything in my life began to spiral out of control”. He firmly rejects the initial White House contention – or “disgusting smear” – that he effectively assaulted a female intern who tried to take the microphone. That contention, Acosta notes, was abandoned.

As the 2020 election approaches, Trump’s war with the press rages on.

March saw the end of the Mueller investigation into Russian election interference, links between Trump and Moscow and possibly obstruction of justice by the president. The special counsel did not find a conspiracy between Trump and Russia and left the question of whether Trump obstructed justice to be contested by Congress, where Democrats now hold the House, and a belligerent administration.

As the president and his aides claimed exoneration, Acosta writes, “Trump once again called the press ‘the enemy of the people’.