President Trump on Wednesday told Rep. Mark Meadows (R-N.C.) — one of his leading congressional allies and a contender for White House chief of staff — that he would like Meadows to remain on Capitol Hill, taking the conservative lawmaker out of contention for the top job in the West Wing.

“Congressman Mark Meadows is a great friend to President Trump and is doing an incredible job in Congress,” White House press secretary Sarah Sanders said in a statement. “The president told him we need him in Congress, so he can continue the great work he is doing there.”

Trump’s request upended the ongoing scramble over the post, with the president still undecided on how to fill the position that will soon be vacated by Chief of Staff John F. Kelly, according to officials.

The Wall Street Journal first reported the president’s move.

Trump spent much of Wednesday in his executive residence speaking privately with friends and senior aides about dozens of candidates, including Meadows, as he tries to narrow down a list that has expanded ever since Vice President Pence’s chief of staff, Nick Ayers, bowed out of consideration over the weekend.

Two names being floated late Wednesday by top Trump aides include acting attorney general Matthew G. Whitaker, who was with the president at last weekend’s Army-Navy football game in Philadelphia, and former Trump deputy campaign manager David N. Bossie, who is scheduled to have lunch with Trump on Friday, according to White House officials. Former New Jersey governor Chris Christie continues to have boosters pushing for him inside the White House.

Trump, after days of hearing out pitches and critiques from Republicans, decided that Meadows — the chairman of the House Freedom Caucus — would better serve him as an ally as Democrats prepare to take over the House, according to two Trump advisers familiar with the talks, who requested anonymity because they were not authorized to speak publicly.

In a conversation with Meadows, Trump praised the House member for his loyalty and informed him of his desire to consider other options, the officials said.

“I’ve had the best job in the world, representing the people of western North Carolina and working alongside President Trump these last two years to give the forgotten men and women of America a voice in their government. I’m fully committed to continuing in both of those roles,” Meadows said late Wednesday in a statement, offering his “total support” to whoever ends up being tapped by Trump.

White House officials argued Trump’s decision was made strategically to avoid a special congressional election and keep Meadows in place to battle House Democrats. Others in Trump’s circle said this week’s boomlet around Meadows was overstated and that he was never close to being offered the job.

As late as Tuesday evening, when Meadows and his wife were at a holiday reception in Washington, Meadows was telling well-wishers that Trump had yet to reach out to him or interview him.

Nevertheless, Trump was intrigued by the idea of Meadows. He also told aides that Meadows was an effective defender on TV and called him a “warrior” for the Trump agenda.

One person close to Trump said the president has expressed interest in picking a brawling adviser and has cited Chicago Mayor Rahm Emanuel, who served as President Obama’s chief of staff, as an example. Trump has mused about Meadows as a possible version of that kind of chief of staff but never leaned toward selecting him, the person said.

Meadows had met with several Trump allies in recent days to gauge what the job would entail — and whether he should take it if offered, with discussions about the legal and political challenges that could be involved, according to four people briefed on those exchanges.

Trump advisers cautioned that the president is unpredictable and to not call anyone a front-runner. Trump told advisers on Tuesday that he liked the guessing game surrounding the position, and the number of names out there showed that people were interested in the position and in joining his administration.

“We have a lot of people that want the job, chief of staff,” Trump told reporters on Tuesday, noting that he could take the remainder of the month to decide.

But those same aides said wild card options could quickly emerge this week as the president takes calls and listens to the counsel of people inside the GOP and in his personal orbit.

Former Virginia attorney general Ken Cuccinelli, for instance, was mentioned by one official on Wednesday as a contender Trump has mulled, while another official said Cuccinnelli was not close to consideration, underscoring the jockeying and uncertainty.