Trump wanted moat on border, new book says. With alligators in it.

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 part of the report in a tweet in which he misspelled “moat.”

Speaking to reporters in the Oval Office on Wednesday afternoon, Trump continued to fume over the report, which he misattributed to the Washington Post.

"So they said, 'President Trump started ranting and raving,'" Trump said. "[They said] that I wanted a wall, but I wanted a moat — whatever that is. Not a word I'd use but they used it. A moat. And in the moat I wanted alligators and snakes. And wanted the wall to be a fence and I wanted it to be electrified. And I wanted sharp spikes at the top, so if anyone gets it, it goes piercing through their skin. Skin-piercing spikes. But I wanted that whole wall to be electrocuted."

“So these two reporters say I want a moat with alligators, snakes, electrified fences so people get electrocuted [if they] so much as touch the fence and spikes on top,” the president continued. “Never said it, never thought of it.”

“It was a lie,” Trump added. “It was a total lie. It was corrupt reporting.”

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.

The 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.”

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 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.”

Cover thumbnail: Yahoo News photo illustration; photos: AP, Getty Images

Read more from Yahoo News: