Department of Energy (DOE) Secretary Rick Perry plans to step down by the end of the year, he said in a letter to President Trump.

“Now more than ever, I believe strongly in the mission of the Department of Energy,” Perry wrote. “The people across the enterprise have a sincere commitment to this country. I feel comfortable that the Department is well prepared to continue this mission with new leadership at the helm.”

Perry said he plans to resign “at a date later this year.”

At an event Thursday in Alvarado, near Dallas, Trump said the former Texas governor is “a very good friend of mine who’s been with me right from the beginning, and somebody that’s going to be going, I guess, at the end of the year.

“He’s done a fantastic job for a long period of time, and we really appreciate it. The Department of Energy has far, far progressed from those days three years ago when you took it over,” Trump said to Perry, according to a White House transcript of the event.

On Twitter Friday afternoon, Trump said he would nominate Dan Brouillette, current DOE deputy Secretary, to replace Perry.

"Dan's experience in the sector is unparalleled," Trump tweeted. "A total professional, I have no doubt that Dan will do a great job!"

The Senate confirmed Brouillette to DOE's second highest position in August 2017. Brouillette had been head of public policy for USAA, is a former vice president of Ford Motor Co. and previously served as chief of staff to the House Committee on Energy and Commerce. He also served as assistant secretary of Energy for Congressional and Intergovernmental Affairs from 2001-2003 and was a member of the Louisiana State Mineral and Energy Board from 2013-2016.

During his tenure at DOE, Perry has overseen the establishment of the Office of Cybersecurity, Energy Security and Emergency Response and the Office of Artificial Intelligence and Technology.

“These new offices will help to provide the underlying research and building blocks for government and the private sector to work together in tackling challenges and pursuing opportunities,” Perry said in his resignation letter.

Perry was also a key ally in Trump’s controversial efforts to prop up the coal and nuclear power industries.  Last year, a leaked draft memo revealed that DOE was considering using its authority to compel the nation's grid operators to purchase electricity or power generation capacity from uneconomic coal and nuclear plants, which have struggled to compete against natural gas. Perry had argued that a notice of proposed rulemaking (NOPR) presented to FERC in 2017 was a necessary bulwark to maintaining grid resiliency, but the Federal Energy Regulatory Commission unanimously rejected the NOPR in January 2018.

“He has been a leader on energy innovation, the expansion of America’s energy trade, and efforts to increase our nation’s cybersecurity,” said Sen. Liza Murkowski (R-AK), chairman of the Senate Energy and Natural Resources Committee.

In recent days, Perry had become entangled in the controversy growing around allegations that Trump asked Ukrainian President Volodomyr Zelensky to investigate political rival Joe Biden and his son in return for U.S. financial aid. White House acting chief of staff Mick Mulvaney said Thursday Trump asked Perry to work with Rudy Giuliani, Trump’s personal attorney, on policies related to Ukraine, but denied that their meeting with Ukrainian officials earlier this year amounted to a “shadow foreign policy” effort, as critics have alleged.

“They were very interested in trying to get Ukraine as an energy partner,” Mulvaney said Thursday during a press briefing at the White House. “That’s why Secretary Perry was so heavily involved. And that’s when the President said to Mr. Perry, ‘Go ahead and talk to Rudy’…There’s not a shadow policy here. The president is entitled to have whoever he wants to work.”

Perry, who famously vowed to dismantle DOE during a failed presidential campaign in 2011, was confirmed as secretary by the Senate in 2017.

Perry was first elected as a Democrat to the Texas House of Representatives in 1984. He served three two-year terms in the chamber before switching to the Republican Party in 1989. Perry was then twice elected as the state's agriculture commissioner, serving two four-year terms before winning the race for lieutenant governor in 1998. He assumed the governorship in 2000 after then-Gov. George W. Bush won the election for president.

Perry won the race for governor in his own right in 2002, and was re-elected in 2006 and 2010. He became the first governor in Texas history to win three four-year terms.