Rick Perry notified President Donald Trump that he was resigning from his post as secretary of the Department of Energy.

Perry told the president before his campaign rally in Dallas.

“It has been a tremendous honor to serve our country in your administration in such a meaningful way,” Perry said in a letter to Trump.

He did not give a specific date when he would leave office, noting that he plans “to resign at a date later this year.”

The Department of Energy made Perry’s resignation letter public on Thursday night, just as Trump announced it during his rally in Dallas.

“He’s going to be leaving at the end of the year, and probably coming back here,” Trump told his Texas supporters. Whatever he does he’s going to be very successful.”