Venting his frustration with immigration earlier this year, President Trump suggested that U.S. soldiers patrolling the southern border shoot migrants in the legs to slow them down, put flesh-piercing spikes atop an electrified border wall and dig a moat.

And fill the moat with snakes and alligators.

That’s according to an excerpt from a new book, “Border Wars: Inside Trump’s Assault on Immigration,” by New York Times reporters Michael D. Shear and Julie Hirschfeld Davis, due out next week. The Times published the excerpt on Tuesday.

Trump floated the man-eating moat idea in March — and advisers reportedly took it seriously enough to “seek a cost estimate.”

It wasn’t the only extreme solution offered by Trump, according to the excerpt:

He wanted the wall electrified, with spikes on top that could pierce human flesh. After publicly suggesting that soldiers shoot migrants if they threw rocks, the president backed off when his staff told him that was illegal. But later in a meeting, aides recalled, he suggested that they shoot migrants in the legs to slow them down. That’s not allowed either, they told him.

Trump denied the report in a tweet, saying it showed “The press has gone Crazy.” He misspelled “moat.”

Notably, the president did not deny suggesting soldiers shoot migrants.

And while Trump denied he ever proposed putting sharp spikes on the border wall, Washington Post columnist Brian Klaas pointed out that the president literally did so in a tweet last year.

A design of our Steel Slat Barrier which is totally effective while at the same time beautiful! pic.twitter.com/sGltXh0cu9 — Donald J. Trump (@realDonaldTrump) December 21, 2018

Those suggestions came after Trump ordered advisers to “shut down the entire 2,000-mile border with Mexico — by noon the next day,” the book said.

“The president was frustrated and I think he took that moment to hit the reset button,” Thomas D. Homan, who had served as Trump’s acting director of Immigration and Customs Enforcement, told the authors. “The president wanted it to be fixed quickly.”

RELATED: Trump visits border wall prototypes amid protests

22 PHOTOS President Trump visits border wall prototypes amid protests See Gallery President Trump visits border wall prototypes amid protests US President Donald Trump is shown border wall prototypes in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) People hold signs during a protest while standing in front of the current border fence and near the prototypes of U.S. President Donald Trump's border wall, in Tijuana, Mexico March 13, 2018. The sign on the right reads "Trump, walls can be jumped over". REUTERS/Edgard Garrido US President Donald Trump inspects border wall prototypes in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) People attach a sign reading "Trump, stop the mass deportations" to the current border fence and near the prototypes of U.S. President Donald Trump's border wall, during a protest in Tijuana, Mexico March 13, 2018. REUTERS/Edgard Garrido US President Donald Trump's motorcade arrives at the border fence in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) People hold signs reading "No to the wall" and "Trump, put your wall, but in your territory, not in ours", during a protest near the prototypes of U.S. President Donald Trump's border wall, seen behind the current border fence, in Tijuana, Mexico March 13, 2018. REUTERS/Edgard Garrido US President Donald Trump is shown border wall prototypes with White House Chief of Staff John Kelly (L) in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) A man holds a sign reading "Trump, put your wall, but in your territory, not in ours", during a protest near the prototypes of U.S. President Donald Trump's border wall, seen behind the current border fence, in Tijuana, Mexico March 13, 2018. REUTERS/Edgard Garrido US President Donald Trump arrives to inspect border wall prototypes in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) People hold signs reading "No to the wall, Trump," and "Trump, we are not enemies of the USA" during a protest near the prototypes of U.S. President Donald Trump's border wall, seen behind the current border fence, in Tijuana, Mexico March 13, 2018. REUTERS/Edgard Garrido US President Donald Trump speaks during an inspection of border wall prototypes in San Diego, California on March 13, 2018. Donald Trump -- making his first trip to California as president -- warned there would be 'bedlam' without the controversial wall he wants to build on the border with Mexico, as he inspected several prototype barriers. The trip to the 'Golden State' -- the most populous in the country and a Democratic stronghold -- was largely upstaged by his own announcement that he had sacked Secretary of State Rex Tillerson. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) Mexican Federal Police officers stand guard the Mexican side of the Mexico-US border in Tijuana, Baja California state, from where prototypes of the border wall, which US President Donald Trump will inspect on the outskirts of San Diego, in the US, are visible on March 13, 2018. Fresh off a cabinet reshuffle, President Donald Trump was headed for Democratic stronghold California on Tuesday to inspect prototypes of the controversial border wall with Mexico that was the centerpiece of his White House campaign. / AFP PHOTO / GUILLERMO ARIAS (Photo credit should read GUILLERMO ARIAS/AFP/Getty Images) People hold signs reading "Trump, we will not pay for the wall" and "Trump, stop the mass deportations" near the border fence between Mexico and the U.S., in Tijuana, Mexico March 13, 2018. REUTERS/Edgard Garrido Journalists gather at a rooftop near the US -Mexico border as President Trump is expected to inspect the border wall prototypes built outskirts San Diego, in Tijuana, Baja California State, Mexico, on March 13, 2018. Fresh off a cabinet reshuffle, President Donald Trump was headed for Democratic stronghold California on Tuesday to inspect prototypes of the controversial border wall with Mexico that was the centerpiece of his White House campaign. / AFP PHOTO / GUILLERMO ARIAS (Photo credit should read GUILLERMO ARIAS/AFP/Getty Images) U.S. police officers use a ladder to climb up a truck parked in front of the prototypes of U.S. President Donald Trump's border wall, on the U.S. side of the current border fence, in Tijuana, Mexico March 13, 2018. REUTERS/Jorge Duenes An agent faces Mexico while standing by the vehicle of U.S. President Donald Trump at the border near San Diego, California, where Trump reviewed wall prototypes designed to serve as a protective barrier against illegal immigrants, drugs and smuggled weapons, March 13, 2018. REUTERS/Kevin Lamarque A U.S. Customs and Border Protection (CBP) Border Patrol Agent sits on horseback near U.S. President Donald Trump's motorcade during a tour of U.S.-Mexico border wall prototypes near the Otay Mesa Port of Entry in San Diego, California. U.S., March 13, 2018. REUTERS/Kevin Lamarque TIJUANA, MEXICO - MARCH 13:Anti-Trump protestors demonstrate on the Mexico side of the border before the arrival of the U.S. President to inspect the prototypes of the proposed border wall on March 13, 2018 in Tijuana, Mexico. (Photo by Wally Skalij/Los Angeles Times via Getty Images) The motorcade carrying US President Donald Trump drives past a US-Mexico border fence as Trump head for an inspection of border wall prototypes in San Diego, California on March 13, 2018. Donald Trump -- making his first trip to California as president -- warned there would be 'bedlam' without the controversial wall he wants to build on the border with Mexico, as he inspected several prototype barriers. The trip to the 'Golden State' -- the most populous in the country and a Democratic stronghold -- was largely upstaged by his own announcement that he had sacked Secretary of State Rex Tillerson. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) Mounted Border Patrol agents are seen as US President Donald Trump inspects border wall prototypes in San Diego, California on March 13, 2018. Donald Trump -- making his first trip to California as president -- warned there would be 'bedlam' without the controversial wall he wants to build on the border with Mexico, as he inspected several prototype barriers. The trip to the 'Golden State' -- the most populous in the country and a Democratic stronghold -- was largely upstaged by his own announcement that he had sacked Secretary of State Rex Tillerson. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) US President Donald Trump inspects border wall prototypes in San Diego, California on March 13, 2018. Donald Trump -- making his first trip to California as president -- warned there would be 'bedlam' without the controversial wall he wants to build on the border with Mexico, as he inspected several prototype barriers. The trip to the 'Golden State' -- the most populous in the country and a Democratic stronghold -- was largely upstaged by his own announcement that he had sacked Secretary of State Rex Tillerson. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) US President Donald Trump holds up a poster of before and after photos of a segment of the border wall prototypes with Chief Patrol Agent Rodney S. Scott (R) in San Diego, California on March 13, 2018. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

Trump is known to lob his quick-fix ideas during briefings, without researching their practicality.

In August, Axios reported that Trump repeatedly suggested homeland and national security officials “explore using nuclear bombs to stop hurricanes from hitting the United States.

During one hurricane briefing at the White House, Trump reportedly said, “I got it. I got it. Why don’t we nuke them? They start forming off the coast of Africa, as they’re moving across the Atlantic, we drop a bomb inside the eye of the hurricane and it disrupts it. Why can’t we do that?”

Trump denied that he ever suggested nuking hurricanes.

The story by Axios that President Trump wanted to blow up large hurricanes with nuclear weapons prior to reaching shore is ridiculous. I never said this. Just more FAKE NEWS! — Donald J. Trump (@realDonaldTrump) August 26, 2019

The cost of digging and fencing a trench along the 2,000-mile border, which includes long stretches of mountainous terrain, would likely be many billions of dollars, not counting the cost of the animals. The usefulness of alligators and snakes as deterrents to migrants is disputed. Authorities agree that accounts of crocodile-filled moats surrounding European castles in the Middle Ages are almost certainly apocryphal, although at least one fortress apparently was guarded by a trench inhabited by bears.

As absurd as it sounds, the gator-filled moat idea is not a novel one in modern U.S. politics. In 2011, President Barack Obama mocked Republicans who were pressing his administration for broader reforms at the border.

“They’ll want a higher fence,” Obama said in a speech in El Paso, Texas. “Maybe they’ll need a moat. Maybe they want alligators in the moat.”

Herman Cain, then a candidate for the 2012 Republican nomination, said it was a great idea.

“I’d have that moat,” Cain told supporters. “And I would put those alligators in that moat.”

More from :

Trump anger over impeachment turns from Pelosi to Schiff

Impeachment support approaching danger zone for Trump: polls

Kamala Harris wants Twitter to suspend Trump after 'civil war' tweet