NEW YORK (AP) — Wherever CNN White House correspondent Jim Acosta goes, he's followed by the g-word, grandstand. He even heard it when he met Ted Olson, the former U.S. solicitor general who was part of the legal team that beat back President Donald Trump's attempt to pull Acosta's reporting pass.

"I can't believe there is grandstanding going on at the White House," Olson told him, and they both laughed, Acosta recounts in his new book.

Usually, it's no laughing matter. Trump's detractors love Acosta's willingness to talk back to the president in attention-getting confrontations. Trump's supporters seethe. Acosta takes Trump on again with the book, "The Enemy of the People," which uses as its title the derisive phrase the president calls the press.

The incident that required Olson's intervention came after a contentious White House news conference last November at which Acosta was called on and said, "I wanted to challenge you on one of the statements that you made in the tail end of the campaign in the midterms."

"Here we go," Trump said, and off they went.

It ended with a back-and-forth about how many questions Acosta got to ask, and a White House intern unsuccessfully trying to grab Acosta's microphone. The administration later pulled Acosta's pass to the White House grounds, triggering the court battle won by CNN.

"Jim Acosta is just somebody who gets up and grandstands," Trump later told the Daily Caller in an interview. "He doesn't even know what he's asking you half the time."

Conservative activists L. Brent Bozell and Tim Graham unloaded on Acosta in their own book, "Unmasked: Big Media's War Against Trump." ''No man in the world of journalism has made a mockery of his profession quite like this man," they wrote. "He lives to be obnoxious."

Washington Post media columnist Erik Wemple countered that news organizations are free to choose reporters with their own styles.

"Yes, it's grandstanding and who cares?" Wemple said in an online commentary.

Acosta mostly deflects the question in an interview, although he said he takes exception to the characterization. He takes it on much more strongly in his book.

"Call me a showboater or a grandstander or 'fake news,'" he wrote. "I will go to my grave convinced deep down in my bones that journalists are performing a public service for the good of the country. The country is better off with reporters in the White House briefing room asking the hard questions, even if we sometimes sound a little over the top. That noise is the sound that a healthy, functioning democracy makes."

After a series of unexploded pipe bombs were sent to CNN and others, Acosta tried to get White House press secretary Sarah Sanders to state publicly which outlets and journalists the administration considered enemies of the people. If anyone thinks he was showboating, Acosta writes, "they can shove it."

Acosta said he wrote the book because he didn't want his two children to grow up in a country where the press is called the enemy.

"I know that sounds corny or like I'm on a soapbox," he said. "I just think that's kind of baseline. The press is here to do a job ... And we just can't have that sort of thing going on."

His book explores the origin of the much-tweeted "enemy of the people" phrase. His sources pointed to former Trump aide Steve Bannon, with the president's help. Acosta recounts a phone call with then-Trump aide Hope Hicks in the early days of the president's attacks on the media; she said Trump told her that Acosta "gets it." He took that to indicate that, at least in the beginning, the "fake news" and "enemy of the people" charges were primarily an act.

It's gone far beyond that, to the point where Acosta and other White House reporters are repeatedly threatened and subject to angry chants when they work a Trump rally.

Acosta criticizes Sanders and her predecessor Sean Spicer, with whom he had plenty of verbal sparring matches when the White House conducted regular press briefings. He's offended by his sense that Trump aides aren't motivated to serve the public that pays their salaries.

Acosta also writes that there are not two sides to a story when it is a matter of right and wrong. As examples, he cites the separation of migrant children from their families, and Trump's comments after a demonstration that included white supremacists in Charlottesville, Virginia, that there were good people on both sides.

So will Acosta takes sides when right and wrong are not clear-cut?

He said he's not referring to debates over tax policy or climate change, for example. But he said he had no problem telling Trump, in one encounter, "Mr. President, there are no fine people in the Nazis."

White House reporters never expected to spend so much time fact-checking an administration, but Acosta believes that most of those covering Trump will be seen by history as having done tough jobs well.

"As reporters these days, we're not just here to report the news. We're here to defend the truth," he said. "We didn't put ourselves in that position. He essentially put us in that position."

Besides the jeers he gets at Trump rallies, Acosta writes of receiving disturbing death threats. He's disheartened that so many Americans are at each other's throats, and he wants to call Trump out on language he believes contributes to it.

Despite the job's difficulties, Acosta's not looking to leave. You sense that he'd like nothing more than to outlast Trump.

"I kind of want to see how the movie ends," he said.