US President Donald Trump sought help from Chinese President Xi Jinping to win re-election, ex-National Security Adviser John Bolton's new book says.
Mr Bolton says Mr Trump wanted China to buy agricultural produce from US farmers, according to details of the forthcoming book previewed by US media.
He also says Mr Trump "remained stunningly uninformed on how to run the White House".
The Trump administration is trying to block the book from going on sale.
Speaking to Fox News, Mr Trump said of Mr Bolton: "He broke the law. This is highly classified information and he did not have approval."
"He was a washed-up guy," the president added. "I gave him a chance."
Wacko John Bolton’s “exceedingly tedious”(New York Times) book is made up of lies & fake stories. Said all good about me, in print, until the day I fired him. A disgruntled boring fool who only wanted to go to war. Never had a clue, was ostracized & happily dumped. What a dope!— Donald J. Trump (@realDonaldTrump) June 18, 2020
John Bolton joined the White House in April 2018 and left in September the following year, saying he had decided to quit. President Trump, however, said he had fired Mr Bolton because he disagreed "strongly" with him.
He is known as a foreign policy hardliner and also served in the administration of President George W Bush. As national security adviser, he was the top counsellor to the US president on security matters at home and abroad.
Mr Bolton's 577-page tome, The Room Where It Happened, is due to go on sale on 23 June.
But on Wednesday night, the Department of Justice sought an emergency order from a judge to stop the book's release.
The publisher, Simon & Schuster, said in a statement: "Tonight's filing by the government is a frivolous, politically motivated exercise in futility."
It said hundreds of thousands of copies of the book had already been distributed around the world and the injunction would accomplish nothing.
Mr Trump's Democratic challenger in this November's election, Joe Biden, said in a statement about the book: "If these accounts are true, it's not only morally repugnant, it's a violation of Donald Trump's sacred duty to the American people."
What does Bolton allege about the meeting with Xi?
The allegations refer to a meeting between President Trump and President Xi at the G20 summit in Osaka, Japan, in June last year.
"Trump, stunningly, turned the conversation to the coming US presidential election [in 2020], alluding to China's economic capability and pleading with Xi to ensure he'd win," Mr Bolton wrote.
"He stressed the importance of farmers and increased Chinese purchases of soybeans and wheat in the electoral outcome."
Farmers make up a key voting bloc and largely supported Mr Trump in the 2016 election.
Speaking on Wednesday evening, US Trade Representative Robert Lighthizer disputed Mr Bolton's account, saying the request for help with re-election "never happened".
Mr Bolton also mentions an earlier conversation at the summit's opening dinner, in which they discussed the building of camps in China's western Xinjiang region.
Mr Trump said the construction should go ahead as it was "exactly the right thing to do".
China has detained about a million Uighurs and other ethnic minorities in the camps for punishment and indoctrination.
The Trump administration has been publicly critical of China's treatment of Uighurs, and on Wednesday the president signed legislation authorising US sanctions against Chinese officials responsible for the repression of Muslims in Xinjiang province.
China denies mistreating Uighurs and attacked the US move, calling it malicious and threatening countermeasures.
On one hand, the account John Bolton offers in his new book should seem somewhat familiar.
This is hardly the first time a former adviser or anonymous current aide to Donald Trump has offered anecdotes about a president seemingly uninterested in the details of governing and uninformed on basic issues of foreign policy. For nearly three-and-a-half years, there have been plentiful stories about a White House rife with backbiting and internal power struggles.
Mr Bolton's book goes beyond this well-trodden ground, however, in painting a broad portrait of a president willing to bend foreign policy to advance his domestic and personal political agenda. This was the heart of the impeachment case congressional Democrats made against Trump in January.
Mr Bolton confirms their allegations that the president wanted the withholding of military aid to pressure Ukraine to provide damaging information about Democratic rival Joe Biden. Mr Bolton adds that Trump's dealings with China were also done with an eye on his re-election, and that he repeatedly intervened to assist friendly autocrats around the world.
Republicans suggest this is all the work of a disgruntled employee trying to sell books, while Democrats are already growling that Bolton should have volunteered these bombshells during the impeachment proceedings. That ship has sailed, of course, but Bolton's book can still have a bite, distracting a presidential campaign struggling to find its footing less than five months before election day.
What else did Mr Bolton say?
Mr Bolton says the impeachment inquiry into the president might have had a different outcome this year if it had gone beyond Ukraine and investigated other instances of alleged political interference.
In January, President Trump was impeached for withholding military aid to pressure Ukrainian President Volodymyr Zelensky into starting a corruption investigation into Mr Biden and his son Hunter.
The president denied the wrongdoing and was acquitted after a two-week trial in the Republican-controlled Senate in February, which did not include any witnesses.
Mr Bolton - who was criticised by Democrats for declining to testify to the hearings - does not discuss in the book whether he thinks that Mr Trump's actions on Ukraine were impeachable.
The publication contains a number of other damaging allegations:
'Oh, are you a nuclear power?'
Among other things, Mr Trump is alleged to have been unaware that the UK was a nuclear power.
Britain's atomic deterrent came up during a meeting with Theresa May in 2018, when it was mentioned by one of the then-prime minister's officials.
According to the book, Mr Trump said: "Oh, are you a nuclear power?" Mr Bolton said he could tell it "was not intended as a joke".
Mr Trump also once asked his former chief-of-staff John Kelly if Finland was part of Russia, writes Mr Bolton.
Invading Venezuela would be 'cool'
Mr Trump said invading Venezuela would be "cool", according to the book, and that the South American nation was "really part of the United States".
But he was less enthusiastic about another invasion. Of the Afghanistan conflict, Mr Trump is quoted in the book as saying: "This was done by a stupid person named George Bush."
Mr Bolton writes that in a May 2019 phone call Russian President Vladimir Putin pulled off a "brilliant display of Soviet-style propaganda" by likening Venezuelan opposition leader Juan Guaidó to 2016 Democratic presidential nominee Hillary Clinton, which "largely persuaded Trump".
Mr Putin's objective was to defend his ally, Venezuelan President Nicolás Maduro, Mr Bolton writes. In 2018, Mr Trump labelled the leftist Mr Maduro a dictator and imposed sanctions, but he clung to power.
In an interview with ABC News to be broadcast in full this Sunday, Mr Bolton says of Mr Trump: "I think Putin thinks he can play him like a fiddle."
'This is a bad place'
Mr Bolton writes that many of the president's closest aides privately disparaged him.
When he arrived at the White House, Mr Bolton said Mr Kelly warned him: "You can't imagine how desperate I am to get out of here. This is a bad place to work, as you will find out."
During Mr Trump's 2018 meeting with North Korea's leader, Secretary of State Mike Pompeo passed Mr Bolton a note about the president that said: "He is so full of shit."
He writes that Mr Pompeo, often described as a Trump loyalist, was among aides who considered resigning in disgust in frustration at working for the president.
Mr Bolton writes that the president "saw conspiracies behind rocks, and remained stunningly uninformed on how to run the White House, let alone the huge federal government."