President Donald Trump said Saturday that chief of staff John Kelly will leave his job by year's end amid an expected West Wing reshuffling reflecting a focus on the 2020 re-election campaign and the challenge of governing with Democrats reclaiming control of the House.

Nick Ayers, Vice President Mike Pence's chief of staff, is Trump's top choice to replace Kelly, and the two have held discussions for months about the job, a White House official said. An announcement was expected in the coming days, the president told reporters as he left the White House for the Army-Navy football game in Philadelphia.

Kelly had been credited with imposing order on a chaotic West Wing after his arrival in June 2017 from his post as homeland security secretary. But his iron fist also alienated some longtime Trump allies, and he grew increasingly isolated, with an increasingly diminished role.

Known through the West Wing as "the chief" or "the general," the retired Marine Corps four-star general was tapped by Trump via tweet in July 2017 from his perch atop the Homeland Security Department to try to normalize a White House riven by infighting and competing power bases.

"John Kelly will leaving — I don't know if I can say retiring — but he's a great guy," Trump said. "John Kelly will be leaving at the end of the year. We'll be announcing who will be taking John's place — it might be on an interim basis. I'll be announcing that over the next day or two, but John will be leaving at the end of the year. ... I appreciate his service very much."

Kelly had early successes, including ending an open-door Oval Office policy that that had been compared to New York's Grand Central Station and instituting a more rigorous policy process to try to prevent staffers from going directly to Trump.

But those efforts also miffed the president and some of his most influential outside allies, who had grown accustomed to unimpeded access. Kelly's handling of domestic violence accusations against the former White House staff secretary also caused consternation, especially among lower-level White House staffers, who believed Kelly had lied to them about when he found out about the allegations.

Lauding Kelly, House Speaker Paul Ryan, R-Wis., said the country was "better for his duty at the White House." He called Kelly "a force for order, clarity and good sense."

Trump and Ayers were working out terms under which Ayers would fill the role and the time commitment he would make, the White House official said. Trump wants his next chief of staff to agree to hold the job through the 2020 election. Ayers, who has young triplets, had long planned to leave the administration at the end of the year, but he has agreed to serve in an interim basis through the spring of 2019.

The official spoke on the condition of anonymity to discuss sensitive personnel matters.

Word of Kelly's impending departure comes a day after Trump named his picks for attorney general and ambassador to the United Nations, and two senior aides shifted from the White House to Trump's campaign.

In any administration, the role of White House chief of staff is split between the responsibilities of supervising the White House and managing the man sitting in the Oval Office. Striking that balance in the turbulent times of Trump has bedeviled both Kelly and his predecessor, Reince Priebus.

White House aides say Trump has developed confidence in Ayers, in part by watching the effectiveness of Pence's largely independent political operation. Ayers also earned the backing of Ivanka Trump and Jared Kushner, the president's daughter and son-in-law and senior advisers, for taking on the new role, White House officials said.

The Georgia native's meteoric rise in GOP politics included a successful stint at the Republican Governors Association, time as campaign manager for former Minnesota Gov. Tim Pawlenty's failed White House bid and consultant work for dozens of high-profile Republicans, including Pence.

Ayers, 36, would be the youngest chief of staff since 34-year-old Hamilton Jordan served under Jimmy Carter. Kelly is 68.

Trump had discussed replacing Kelly on multiple occasions, including following the negative publicity surrounding Kelly's handling of domestic violence accusations against then-White House staff secretary Rob Porter. Some lower-level White House staffers believed Kelly had lied to them about when he knew of the allegations and when he made clear to Porter that he'd have to leave.

Trump had often tossed around potential replacements, but sensitive to charges that his administration has been marked by record turnover, he said in July that he would keep Kelly in the job through 2020.

But inside the White House, it was viewed largely as an attempt to clamp down on speculation about Kelly's fate during the midterm elections, rather than a true vote of confidence.

Kelly, too, made no secret of the trials of his job, and often joked about how working for Trump was harder than anything he'd done before, including on the battlefield. In private, Kelly, whom friends said took the job out of a sense of duty to his country, cast himself as safeguarding the public from an impulsive and mercurial president. Reports of those conversations infuriated the president, who is especially sensitive of attacks on his competence and perceptions he is being managed.

At an event celebrating the 15th anniversary of the Department of Homeland Security, Kelly joked that he missed everyone in the department "every day," offering a deadpan eye roll and smile that drew laughs and applause.

"At six months, the last thing I wanted to do was walk away from one of the great honors of my life, being the secretary of Homeland Security, but I did something wrong and God punished me, I guess," he joked.

Kelly, who had threatened to quit on several occasions, told friends he would be happy if he lasted until his one-year anniversary: July 28.

__

Associated Press writers Michele Salcedo and Catherine Lucey contributed to this report.

__

Follow Miller on Twitter at https://twitter.com/ZekeJMiller and Colvin at https://twitter.com/colvinj