President Donald Trump nearly pulled the US out of two major trade deals in 2017, according to the veteran journalist Bob Woodward's new book, excerpts of which were published by The Washington Post on Tuesday.

According to The Post, Woodward reports that Gary Cohn, Trump's former top economic adviser, prevented withdrawals from the North American Free Trade Agreement and a deal with South Korea by stealing documents authorizing the moves from Trump's desk.

Cohn and Trump clashed on trade policy and the president's response to the violence last year in Charlottesville, Virginia.

Cohn left the White House in March.

President Donald Trump almost yanked the US out of two of the country's largest trade deals, only to be foiled when Gary Cohn, his economic adviser, snatched documents authorizing the withdrawals from his desk.

That's according to the veteran journalist Bob Woodward's new book, "Fear," which documents the chaos of the Trump White House — including Trump's desire to scuttle some of the world's largest free-trade agreements. The Washington Post, where Woodward is an associate editor, on Tuesday published excerpts of the book, set to be released on September 11.

According to Woodward, Trump wanted to pull the US out of both the North American Free Trade Agreement, the seminal trade deal with Canada and Mexico known as NAFTA, and the US-Korea Free Trade Agreement, known as KORUS.

In the first instance outlined in the excerpts, to prevent a possible economic disaster, Cohn "stole a letter off Trump's desk" that would have removed the US from KORUS, which sets the rules for the nearly $150 billion in trade between the US and South Korea.

Cohn told colleagues that Trump never noticed the letter was missing, according to Woodward.

Additionally, in the spring of 2017, Trump had his staff secretary at the time, Rob Porter, draft an order to remove the US from NAFTA. When Porter informed Cohn of the document, the economic adviser again used the tactic to prevent the collapse of the trilateral trade agreement, according to Woodward.

"I can stop this," Cohn is quoted as telling Porter in the book, per The Post. "I'll just take the paper off his desk."

Economists have warned that pulling the US out of NAFTA would have dire economic consequences because of the tightly integrated economies of the US, Canada, and Mexico.

Trump rolled out a new preliminary trade agreement with Mexico on August 27 and is negotiating with Canada on an update to NAFTA. While it is unclear whether a final deal will ultimately be an updated NAFTA or a new agreement, Trump has continued to bash the trilateral deal. He has also threatened to pull out of it and move forward with just Mexico.

Meanwhile, the Trump administration announced a revision of KORUS in March, though the edited deal is still being finalized.

The episodes described in Woodward's book underscore Cohn's repeated clashes with Trump, which came not just on trade issues but also over the president's response to the violent white-supremacist-led protests in Charlottesville, Virginia, in August 2017.

Cohn has said he nearly resigned over Trump's press conference in which the president blamed both white-supremacist protesters and counterprotesters. According to Woodward, Cohn, who is Jewish, was particularly troubled after a swastika was found on the door of his daughter's college dorm room.

Trump persuaded Cohn to stay on after Charlottesville, but the former Goldman Sachs executive ultimately left the White House in March after Trump moved forward with tariffs on imports of steel and aluminum.

The White House responded later Tuesday to the book.

"This book is nothing more than fabricated stories, many by former disgruntled employees, told to make the president look bad," the White House press secretary, Sarah Huckabee Sanders, said in a statement.

And the White House chief of staff, John Kelly, decried "Fear" as "another pathetic attempt to smear people close to President Trump and distract from the administration's many successes."