WASHINGTON — Rick Perry has achieved the truly improbable.

Five years after proposing to eliminate the U.S. Energy Department, the former Texas governor will now lead that agency. Months after swapping insults with Donald Trump, he's now in the president's Cabinet. Weeks after being a reality TV punchline, he's revived his political career.

All that hung in the balance Thursday when the Senate voted 62-37 to confirm Perry as energy secretary.

"This is about our country," Perry said after being sworn in."We collectively understand that the opportunity we have been given, this is maybe a once in a lifetime opportunity to truly put America on a course that will deliver for future generations extraordinary opportunities."

The comfortable margin highlighted the general lack of rancor surrounding Perry's nomination, despite deep partisan divides over Trump's Cabinet. Every Republican, including Texas Sens. John Cornyn and Ted Cruz, backed Perry. So did 10 Democrats and one independent.

The Texan will now lead a sprawling department whose $30 billion budget covers nuclear stockpiles, environmental cleanup and all manner of scientific research.

Given that focus, many environmentalists and other critics continue to emphasize that Perry's credentials don't align with the agency's goals. But a broad group of backers have dismissed that critique, pointing to the Perry's record tenure of running a major energy state.

"You don't necessarily need to have a scientist in order to lead scientists," said Sen. Lisa Murkowski, head of the Senate Energy and Natural Resources Committee. "You need to have somebody who is a good, strong, competent and capable manager, and that's what Governor Perry has demonstrated."

Incoming Energy Department Secretary Rick Perry (L) and Department of Housing and Urban Development Secretary Ben Carson arrive to a joint session of the U.S. Congress with U.S. President Donald Trump on February 28, 2017 (Photo by Alex Wong/Getty Images)

Perry's record hung over much of his confirmation process.

He had once called Trump a "cancer on conservatism," while the billionaire had said that Perry started wearing glasses so "people think he's smart." The Texan has offered skepticism in the past over climate change, even as he oversaw a massive expansion of wind power in the Lone Star State.

And, of course, there was his past disregard for the Energy Department.

Perry proposed getting rid of the agency when he was a presidential candidate in 2011. That stance was etched into political lore when he couldn't remember at a GOP primary debate that the agency was on his chopping block, summing up the moment with a brutal "oops."

"My past statements made over five years ago about abolishing the Department of Energy do not reflect my current thinking," Perry said in January, offering his regrets.

Some Democrats and environmentalists have nonetheless voiced deep concerns, citing Perry's longstanding ties to the oil and gas business and his spotty record with science. And even though the Texan's confirmation was largely uneventful, many of those worries remain.

Sen. Dianne Feinstein, D-Calif. said Perry has "not show the knowledge or commitment" to shape energy policy and oversee America's nuclear arsenal. Sierra Club Executive Director Michael Brune went further to say that the consequences of Perry's confirmation were "dire."

"The Department of Energy is now in the hands of someone who promotes dirty fossil fuels rather than the advancing clean energy market all the while ignoring the climate crisis," Brune said.

But a cavalcade of Texas Republicans — on Texas Independence Day, no less — rushed to Perry's defense.

Sen. John Cornyn touted Perry's "commonsense approach to regulation and support for thoughtful innovation." Rep. Joe Barton of Arlington championed Perry's "strong energy background" and a "track record of proven executive leadership."

Even the likes of Texas Tech University System chancellor Robert Duncan, a former Republican state lawmaker, chimed in with praise.

"Rick Perry has earned his reputation as a hard worker and legislator who's not afraid to make the hard choices for the right reasons," he said.

With the confirmation process now behind him, Perry must now cement his credibility with the Energy Department's tens of thousands of scientists and contractors.

Experts have said that many career employees remain anxious about their future in a Trump administration. And though Perry doesn't have the scientific pedigree of his nearest predecessors, he has cast himself as someone who will be a fierce agency advocate.

He has vowed to visit all 17 national laboratories. He has stressed the fundamental need to maintain "American leadership in the area of scientific inquiry." And has he offered some assurances that he would defend the agency from budget cuts and other interference.

""I'm not going to tell you that I'm going to be 1,000 percent successful in that," Perry said in January. "But people who know me ... know my commitment to making sound science, economic science connected together."