WASHINGTON -- Former national security adviser John Bolton has leveled a stunning accusation against his former boss, claiming in his new book that U.S. President Donald Trump personally asked his Chinese counterpart, Xi Jinping, to help him win the 2020 U.S. presidential election, according to a copy obtained by CNN Wednesday.

Bolton also charged that when Xi told Trump during a meeting at last year's G-20 summit that China was building concentration camps for the mass detention of Uyghur Muslims, Trump said Xi should go ahead building the camps, "which he thought was exactly the right thing to do."

At another meeting during the G-20 Summit in Osaka, Bolton writes Trump "stunningly" turned the conversation to the upcoming 2020 election. The former national security adviser said Trump "stressed the importance of farmers and increased Chinese purchases of soybeans and wheat in the electoral outcome," adding that he "would print Trump's exact words, but the government's prepublication review process has decided otherwise."

Bolton said the conversation turned back to the trade deal, and Trump "proposed that for the remaining $350 billion of trade imbalances (by Trump's arithmetic), the U.S. would not impose tariffs, but he again returned to importuning Xi to buy as many American farm products as China could."

The allegation that Trump asked the leader of a major US adversary to help him win the next election will reverberate across Washington six months after Trump was impeached on charges he sought help from Ukraine with his reelection bid. Trump openly asked China to investigate his Democratic opponent, former Vice President Joe Biden last year, and has refused to accept the conclusion of U.S. intelligence agencies that Russia interfered in the 2016 election to try to help him win.

The claims come as the Trump campaign has tried to make China a central issue of the 2020 election, framing the President as tougher on Beijing than Biden.

The interactions with Xi were just some of the unflattering details about Trump contained in Bolton's book, titled "In the Room Where it Happened." Bolton also writes that Trump directly connected US security aid to Ukraine with an investigation into his presumptive 2020 opponent -- the key allegation in the Democrats' impeachment case -- and accuses Trump repeatedly of lying.

Legal battle escalates

The book has been subject to a months-long legal battle between the White House and the former national security adviser.

The fight escalated Tuesday after the Trump administration went to court to try to claw back Bolton's earnings for the book and to potentially stop its publication, arguing in a lawsuit that Bolton had breached non-disclosure agreements and was risking national security by exposing classified information.

But the White House's legal action has done little to stop details from Bolton's book from becoming public as CNN and other media outlets reported Wednesday that they obtained advanced copies. It's scheduled for official release next week.

The Justice Department asked a judge Wednesday for emergency help to stop Bolton's book publication, taking another last-ditch step in court to ramp up pressure on the former national security adviser the week before his bombshell book is released to the public.

Several top intelligence and national security officials submitted sworn statements to the judge about classified information in Bolton's book, amounting to an extraordinary level of firepower in the Justice Department's latest emergency filing in court.

The officials, including Director of National Intelligence John Ratcliffe, National Security Agency Director Paul Nakasone, and Director of the National Counterintelligence and Security Center William Evanina, wrote in affidavits that the book still contained classified information.

In a letter sent to the White House last week, Bolton's lawyer, Charles Cooper, accused the White House of seeking to block the book for "purely political reasons," adding that "as a practical matter, (it) comes too late."

'Driven by reelection calculations'

Bolton's book provides detailed accounts of Trump's interactions with Xi.

At the G-20 summit, Bolton writes that when Xi proved amenable to reopening trade discussions, Trump extolled the Chinese leader as the greatest in that country's history. Broadly speaking, Bolton characterized Trump's interactions with Xi as "adlibbed," bolstered by personal flattery and driven by political ambition rather than policy.

"I am hard-pressed to identify any significant Trump decision during my White House tenure that wasn't driven by reelection calculations," Bolton writes.

Bolton described a litany of China-related matters where Trump subverted the US position based on conversations or gestures for Xi -- tariffs, telecommunications, Hong Kong protests, even China's mass detention of Uyghur Muslims.

"At the opening dinner of the Osaka G-20 meeting in June 2019, with only interpreters present, Xi had explained to Trump why he was basically building concentration camps in Xinjiang. According to our interpreter, Trump said that Xi should go ahead with building the camps, which Trump thought was exactly the right thing to do," Bolton writes. "The National Security Council's top Asia staffer, Matthew Pottinger, told me that Trump said something very similar during his November 2017 trip to China."

The US State Department estimates that more than one million Uyghurs, ethnic Kazakhs, Kyrgyz, and members of other Muslim minority groups have been detained by the Chinese government in internment camps, where they are reportedly "subjected to torture, cruel and inhumane treatment such as physical and sexual abuse, forced labor, and death." Secretary of State Mike Pompeo called Beijing's treatment of the Uyghurs "the stain of the century."

On the massive pro-democracy protests in Hong Kong last year, Bolton claimed that Trump said he didn't "want to get involved," and, "we have human-rights problems too." In recent weeks, Trump has announced actions against China for its moves against Hong Kong's autonomy.

Putin thinks he can play Trump 'like a fiddle'

Xi was not the only world leader who Bolton says had Trump's number.

In an interview with ABC News, Bolton said he thinks Russian President Vladimir Putin thinks he can play Trump "like a fiddle," according to a clip that aired Wednesday.

"I think Putin is smart, tough. I think he see that he's not faced with a serious adversary here. I don't think he's worried about Donald Trump," Bolton said.

Trump has previously claimed that no other president has been tougher on Russia than he has but that claim has been questioned by several of his own advisers, in addition to Bolton.

North Korean leader Kim Jong Un was also able to manipulate Trump, Bolton says in his book.

Bolton writes extensively about his disagreements with Trump's approach to North Korea before, during, and after the Singapore summit with Kim, which Bolton hoped would "collapse" before it happened and compared to the appeasement of Nazi Germany, even quoting Winston Churchill.

"The whole diplomatic fandango was South Korea's creation," Bolton writes, "relating more to its 'unification' agenda than serious strategy on Kim's part or ours."

Despite the objections of his advisers, Bolton writes that "Trump was desperate to have the meeting at any price."

Bolton then writes that Kim had Trump "hooked" at the Singapore summit as they flattered each other in their meeting.

When Trump told Kim he would seek Senate approval of any nuclear deal, Bolton writes Pompeo passed Bolton a note saying "he is so full of shit." Bolton suggests Pompeo was referring to Trump, not Kim.

The State Department did not immediately respond to CNN's request for comment regarding Bolton's claim.

That was not the only time Trump's former national security adviser said top aides questioned, and even mocked, Trump in private.

Bolton says Trump repeatedly requested military options for Venezuela, a request that shocked several administration and military officials.

After one meeting at the White House with Florida Republican lawmakers, Bolton says Trump was convinced to throw his unequivocal support opposition leader Juan Guaido, after repeatedly wavering on doing so, yet still asked for a military option.

"Trump still wanted a military option, raising questions with the Florida Republicans who were plainly stunned, except for {Sen. Marco} Rubio who had heard it before and knew how to deflect it politely."

Bolton says he then called then-acting Defense Secretary Patrick Shanahan and chairman of the Joint Chiefs of Staff Gen. Joseph Dunford. "None of us thought that a military option was advisable at this point. To me, this exercise was solely to keep Trump interested in the objective of overthrowing Maduro, without actually wasting a lot of time on a nonstarter," Bolton writes.

"I had the easy job, closing by saying 'All I had to do was make the call,'" Bolton adds, noting that Dunford then responded jokingly, "'Tag, I'm it!'"

"At least he still had a sense of humor," Bolton notes.

Bolton says Democrats committed 'impeachment malpractice'

Trump's interactions with Xi are not the only examples of actions by the President that Bolton claims were troubling and should have been investigated as part of the House impeachment inquiry, which only focused on matters related to Ukraine, according to the the book.

Specifically, Bolton highlights Trump's willingness to intervene in criminal investigations "to, in effect, give personal favors to dictators he liked," noting cases involving law firms in China and Turkey. "The pattern looked like obstruction of justice as a way of life, which we couldn't accept," Bolton writes.

House Democrats wanted Bolton to testify last year, but he refused to do so, threatening a legal battle if he was subpoenaed. Bolton offered to testify during the Senate impeachment trial, but Republicans voted to reject hearing from any witnesses.

Bolton wrote that the Democrats' conducted a hurried, partisan investigation, and accused them of committing "impeachment malpractice" by only focusing on Trump's involvement with Ukraine.

On Wednesday, Democrats criticized Bolton for caring more about his book sales than Trump's misconduct, while Republicans questioned Bolton's credibility and accused him of having an ax to grind.

Bolton devotes his final chapter to the Ukraine matter, in which he was part of several key meetings, including some described by other witnesses during the impeachment proceedings. But Bolton leveled an accusation in the book that no impeachment witness did: that he directly heard Trump tie withholding US security aid to an investigation into the Bidens.

"The next morning, August 20, I took Trump's temperature on the Ukraine security assistance, and he said he wasn't in favor of sending them anything until all the Russia-investigation materials related to Clinton and Biden had been turned over," Bolton writes.

Bolton declines to say whether he thinks Trump should have been impeached. "Whether Trump's conduct rose to the level of an impeachable offense, I had found it deeply disturbing, which is why I had reported it to White House Counsel Pat Cipollone and his staff and Attorney General Bill Barr, and why Pompeo, Mnuchin, and I had worried over it in our own conversations."

Bolton argued that even if he had been called to testify by the Senate, he is "convinced" that it would have made "no significant difference" to the outcome.

This story has been updated with additional details from the copy of the book obtained by CNN.