President Trump touted the idea of building a solar border wall between the U.S. and Mexico for the first time in public on Wednesday night, speaking at a campaign-style rally in Iowa.

"I'm thinking of something that's unique, we're talking about the southern border -- lots of sun, lots of heat. We're thinking about building the wall as a solar wall, so it creates energy and pays for itself," he said, and the crowd cheered.

"You're the first group I've told that to: a solar wall," he continued. "Makes sense, let's see. We're working it out, let's see. A solar wall. Panels, beautiful."

"Pretty good imagination, right? My idea. So we have a good shot. That's one of the places that solar really does work, with the tremendous sun and heat -- it really does work there," said Trump. "So we'll see what happens with that. That would be great. And I think we could really make it look beautiful that would be nice."

Trump's comments confirm reports from earlier this month that he was considering a solar border wall. He addressed the proposal directly in a speech yesterday congratulating the Republican winners of Tuesday's special elections in South Carolina and Georgia.

While some in the cleantech industry have entertained the idea of building a solar border wall, both seriously and in jest, the concept of installing solar panels over the entirety of a 50-foot-high barrier that's roughly 1,000 miles long would likely have such a high price tag -- among other issues -- that it's difficult to see how the project could become a reality. 

The biggest setback for the solar border wall is that the president has yet to secure funding for any type of border wall. And there's no indication that it will win support from Congress.

It's not entirely clear how serious Trump is about installing solar panels, in the event a wall does get funding. But it's notable that the president addressed it, nonetheless. 

Trump's acknowledgement of solar's cost-effectiveness comes after he criticized the renewable resource on the campaign trail.

"I know a lot about solar -- I love solar," Trump said at an event in California last summer, NPR reports. "Except there's a problem with it. It's got a lot of problems with it. One problem is it's so expensive."

Trump also referenced the now-bankrupt solar firm Solyndra while criticizing U.S. energy policies during a presidential debate last year. And since taking office, Trump has sought to slash government funding for renewable energy programs, and put renewable energy critics in key leadership positions. He's also bashed wind farms for being ugly and unreliable. 

In this context, the president's solar wall comments represent an unexpected endorsement of renewable energy. However, Trump appears to have little interest in deploying low-carbon energy resources at scale. In last night's speech, he reiterated his position that staying in the Paris climate accord would have cost millions of jobs, "billions and billions of lost dollars" and put the U.S. at a "permanent economic disadvantage."

"I could tell you stories; I could give you stats; I could go on all day. It's a catastrophe if we would have agreed," he said. "And they all say it's non-binding. Like hell it's non-binding. When we get sued by everybody because we thought it was non-binding, then you can tell me it was non-binding."