Washington (CNN) White House chief of staff John Kelly will be leaving his position at the end of the year, President Donald Trump told reporters at the White House on Saturday afternoon.

"John Kelly will be leaving at the end of the year," Trump told reporters before departing the White House for the Army-Navy game.

Trump noted Kelly had been with him for almost two years in his roles as chief of staff and secretary of homeland security.

"I appreciate his service very much," Trump said.

Kelly's status had become endangered in recent months as his relationship with the President deteriorated. He was not on speaking terms with Trump during his last days, two officials told CNN, and their relationship was no longer seen as tenable.

Vice President Mike Pence's chief of staff, Nick Ayers, has been considered a top contender to replace Kelly for more than six months. But Trump did not announce a replacement for Kelly on Saturday, saying only that he will in the coming days, and it's still unclear if Ayers will be offered the job.

A White House official told CNN that the President and Ayers are still negotiating terms for him to become Trump's chief of staff.

Ayers has told Trump that he wants to move back to his home state of Georgia at the end of the year, citing his young children, the official said. But Ayers offered to postpone it and become chief of staff temporarily. Trump, however, wants a two-year commitment.

Ayers and Kelly both typically join Trump and Pence during their weekly lunch in the dining room outside the Oval Office.

Kelly, who did not travel with the President to Kansas City on Friday, was also reportedly interviewed by special counsel Robert Mueller's team in recent months, three people with knowledge of the matter told CNN. The White House did not respond to request for comment about the discussions.

Kelly had been on the verge of resigning or being fired several times, only to bounce back each time. He was brought on to bring order to the White House, but his influence waned in recent months, and his time as chief of staff was often marked by the same infighting and controversy that has largely defined Trump's presidency from the beginning.

Trump and Kelly had discussed the chief of staff's departure over the last 24 hours, a source familiar with the matter told CNN. Although it was not the plan to announce the move on the South Lawn, Kelly, knowing Trump, realized it could come at any moment, whether by tweet or abrupt announcement, the source said.

Kelly was expected to announce at the senior staff meeting Monday his plans to leave his position later in the month, a source familiar with the situation said. He told people that he didn't think it would be that long for his departure to become public, the source said.

Once seen as stabilizing force

When Kelly first replaced Reince Priebus as chief of staff, he ruled with an iron fist. He curbed Oval Office access, blocked certain outsiders from being able to call the White House switchboard and executed authority over staffing. But in the last months of his tenure, Kelly saw his status as chief of staff diminish.

Trump began circumventing many of the policies and protocols Kelly enacted. And Trump often vacillated between criticizing and praising Kelly, sometimes within minutes of each other. Kelly started holding increasingly fewer senior staff meetings — once daily occurrences that were whittled down to weekly gatherings — and exerted less control over who talked to the President, which was once his sticking point.

Kelly's tenure working for Trump was marked by controversies, and officials were often amazed at how he managed to survive. Weeks after taking over for Priebus, his predecessor who was unceremoniously fired over Twitter while he sat on a rainy tarmac, Kelly was faced with the Charlottesville, Virginia, controversy. He was photographed looking grim-faced in the lobby of Trump Tower as the President declared there were "good people" on both sides of the racist violence.

White House officials believed Kelly was close to resigning after he got into a heated argument that turned into a shouting match with national security adviser John Bolton in October. Bolton had criticized Department of Homeland Security Secretary Kirstjen Nielsen during a discussion about the border, and Kelly stormed out of the West Wing after their profanity-laced argument.

At times, Kelly was the source of his own downfall. He insulted Rep. Frederica Wilson, D-Florida, using inaccurate information, later declaring he would "never" apologize. He said some of those eligible for protections under the Deferred Action for Childhood Arrivals program were "lazy."

But perhaps most damaging was his handling of the situation involving former White House staff secretary Rob Porter, who was accused by two of his ex-wives of abuse. Kelly's shifting accounts caused his credibility inside the West Wing to plummet, and it never truly recovered, according to officials.

Kelly's highly criticized handling of the Porter controversy was an inflection point in his tenure, and some of his internal relationships became strained in the months that followed the former staff secretary's ouster.