By Steve Holland and Timothy Gardner

FORT WORTH, Texas/WASHINGTON (Reuters) - U.S. Energy Secretary Rick Perry will step down by the end of the year, President Donald Trump said on Thursday, a day before a deadline set by congressional Democrats for Perry to turn over documents in the impeachment probe.

Trump told an event in Texas that he had known for months that Perry would resign.

“Rick and I have been talking for six months. In fact, I thought he might go a bit sooner," Trump said. "But he’s got some very big plans. He’s going to be very successful. We have his successor. We'll announce it pretty soon."

Deputy Secretary Dan Brouillette, who has attended several international energy meetings in recent months, is widely expected to replace Perry.

Perry, 69, who was the longest-serving governor of Texas and faced off against Trump in the 2016 Republican presidential nominating contests, said earlier this month he had no plans to step down, denying a media report that he was expected to announce his resignation in November.

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

In recent weeks, Perry has found himself engulfed in the impeachment investigation threatening Trump's presidency. Three Democratic-led U.S. House of Representatives committees issued a subpoena on Oct. 10 for Perry to turn over documents on any role he played in Trump's bid to get Ukraine to investigate a political rival.

The probe focuses on Trump’s efforts to pressure Ukraine President Volodymyr Zelenskiy in a July 25 call to investigate his unsubstantiated allegation that former Vice President Joe Biden, a leading contender for the 2020 Democratic presidential nomination, improperly tried to aid his son Hunter’s business interests in Ukraine.

White House acting chief of staff Mick Mulvaney said earlier on Thursday that Trump had directed Perry to work on Ukraine policy with Trump's personal lawyer, Rudy Giuliani.

Critics have accused Giuliani, who was not a U.S. government official, of conducting a shadow Ukraine policy.

In a visit to Ukraine for Zelenskiy's inauguration in May, Perry had recommended that he talk about energy reforms with two Texas businessmen Michael Bleyzer, a Ukrainian-American, and Robert Bensh, a frequent visitor to Ukraine, as well as unnamed Energy Department experts, a department official said earlier this month.

The Associated Press reported at the time that an unnamed source said Perry had pushed for Bleyzer to be put on the board of Naftogaz, the Ukrainian state oil and gas company, after meeting with Ukrainian officials during his visit.

Before Zelenskiy was president, Perry helped seal a deal to sell U.S. coal to Ukraine and had worked with the country and others on providing Europe an alternative to its dependence on gas from Russia. Perry talked up shipments of U.S. liquefied natural gas, a booming industry, as "freedom gas" for Eastern Europe.

Perry was virtually free of the ethics investigations that weighed on other Trump administration officials. He has been a champion of U.S. oil and gas production and the nuclear industry, but failed to achieve a goal of subsidizing aging U.S. coal and reactors facing a rash of closures.

TOUGH ON IRAN, FRIEND TO SAUDI ARABIA

Perry has tried to persuade Saudi Arabia, the world's largest oil exporter, to build nuclear power plants using U.S. technology.

He often met Saudi Arabian Energy Minister Khalid al-Falih, a fellow alumnus of Texas A&M University, about the kingdom's plans to build its first two commercial nuclear power plants. In September, Saudi Arabia’s king replaced Falih with his son, Prince Abdulaziz bin Salman, whom Perry had met before.

The Trump administration kept the civilian nuclear talks quiet, a source of friction with Democrats in Congress who wanted to ensure that the kingdom would agree to strict nonproliferation standards.

The Energy Department issued seven licenses to companies to share sensitive information on nuclear power with Riyadh, including two that were issued after the killing of journalist Jamal Khashoggi in the Saudi consulate in Istanbul last year.

Riyadh plans to issue a multibillion-dollar tender for the nuclear plants in 2020.

Perry, who advocated for maximum pressure on Iran over its nuclear and missile programs and influence in Syria and Iraq, also talked with Falih about oil. In 2018, Trump pressed Saudi Arabia to boost oil exports ahead of his administration's unilateral reimposition of sanctions on Iran's oil exports.

Falih explained to Perry then that global demand was not strong enough to justify a big boost in output and depended on Perry to explain that to Trump to reduce pressure on the kingdom.

(Reporting by Steve Holland in Fort Worth, Texas, and Timothy Gardner in Washington; Additional reporting by Makini Brice in Washington; Editing by Tom Brown and Peter Cooney)