Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Gov. Rick Perry told lawmakers Thursday that he regretted calling for the elimination of the Department of Energy, an agency he once famously forgot on a presidential debate stage and that he is now set to oversee if confirmed as its secretary.

“My past statements made over five years ago about abolishing the Department of Energy do not reflect my current thinking,” said Perry in his opening remarks before the Senate Committee on Energy and Natural Resources. “In fact, after being briefed on so many of the vital functions of the Department of Energy, I regret recommending its elimination.”

Perry, of course, is perhaps best remembered as a two-time presidential candidate for failing to recommend the elimination of the agency. During the 2012 campaign, he botched a debate question about the federal agencies that he believed should be abolished, famously saying “oops” when he could not remember the name of the Energy Department. The incident marked the end of his campaign.

As energy secretary, Perry pledged Thursday to modernize the country’s nuclear stockpile, promote and develop American energy “in all forms,” protect the agency’s science and technology mission and carefully dispose of nuclear waste.

Energy Secretary-designate, former Texas Gov. Rick Perry, testifies on Capitol Hill in Washington, D.C., Jan. 19, 2017, at his confirmation hearing before the Senate Energy and Natural Resources Committee. Carolyn Kaster / AP

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

He also promised to rely on scientific data when making decisions about climate change, which he said is occurring, in part, by man-made activity.

“I believe the climate is changing,” Perry said. “I believe some of it is naturally occurring, but some of it is caused by man-made activity. The question is how do we address it in a thoughtful way that doesn’t compromise economic growth, it affects the affordability of energy, or American jobs.”

Perry largely stuck to that script when grilled by Sen. Bernie Sanders of Vermont about whether he would work to dramatically cut carbon emissions. Asked in a testy round of questioning whether he agreed with the scientific community that climate change is a global crisis, Perry repeatedly pointed to his record of balancing environmental and economic concerns in his home state.

"Don't you think that is a good thing?" Perry said, referring to carbon cuts in Texas.

"What would be a better thing for you to say right now is that we have a global crisis and that the U.S. should help lead the world," Sanders said.

Perry was introduced to the committee Thursday by Republican Sen. John Cornyn of Texas and Democratic Sen. Joe Manchin of West Virginia, both of whom championed the cabinet nominee for his “all of the above” approach to energy policy during his 14 year tenure as governor of the Lone Star State. Critics have called Perry unprepared and unqualified for the job, but Manchin expressed faith he would learn fast and succeed.

“No one gave us a manual when we became governor,” said Manchin, who served as governor of West Virginia from 2005 to 2010. “I have no doubt that Rick is not only going to be able to do the job; he’s going to excel in the job.”

Perry faced tough questions from Democratic lawmakers on the committee about whether he’d protect the agency’s scientific budget and preserve continuity at the National Nuclear Security Administration (NNSA), whose top officials have not yet been invited to continue their service beyond Jan. 20, according to Gizmodo.

Perry said he had sat down with retired Lieutenant General Frank G. Klotz, the current under secretary of energy for the NNSA, and that he hoped to see continuity in that agency.

Pressed by Democratic Sen. Mazie Hirono of Hawaii about whether he supported massive cuts to the DOE reportedly put forward by staffers of President-elect Donald Trump’s transition team, Perry joked: “Maybe they’ll have the same experience I had and forget they said that.”

The most entertaining exchange of the hearing, however, came when Perry inadvertently made a sex joke to Democratic Sen. Al Franken.

"Did you enjoy meeting me?" Franken asked, referencing an earlier sit-down the two men had on Capitol Hill.

"I hope you are as much fun on that dais as you were on that couch," Perry said, before realizing how it sounded and turning around laughing. "I think we found our Saturday Night Live soundbite."

Franken, a former cast member of SNL, replied: "Let's move on."