Energy Secretary Rick Perry informed President Donald Trump Thursday of his plan to resign from his position later this year.

“There is much work to be done in these upcoming weeks and I remain fully committed to accomplishing the goals that I set out to accomplish at the beginning of my tenure,” Perry said a YouTube video announcing his planned resignation.

Trump told reporters Thursday that he accepted Perry’s resignation.

“Rick has been with me three years and he’s been outstanding,” Trump said.

Perry tweeted Thursday night touting the modernization of the U.S. energy program and saying he is honored to have been a part of it.

“Serving as Secretary of @ENERGY under @realDonaldTrump has been the honor of a lifetime,” he wrote. “Today the U.S. leads the world in energy production, we launched AI & Cyber Security Offices, & made environmental progress unseen for decades cleaning up the legacy of the Manhattan Project.”

Perry has recently come under scrutiny for his role in the Ukraine scandal. He reportedly tried to change the board of the Ukrainian gas company Naftogaz in order to give favorable contracts to companies ran by Trump allies. His shortlist of candidates included at least one of his political donors.

Although he has not been accused of any wrongdoing, he was subpoenaed last Thursday by House committees investigating the Trump impeachment inquiry for documents related to Perry’s role in U.S. energy policy in Ukraine.

Perry said in early October that he would cooperate with the House investigation.

“I’ll just briefly say we’re going to work with Congress and answer all their questions,” he said at a department event on artificial intelligence and energy.

While he has not specified at date of departure, Perry told the Wall Street Journal  Wednesday that he plans to still be working by Thanksgiving.