Hope Hicks, President Donald Trump's communications director and one of his longest-serving advisers, said Wednesday that she planned to leave the White House in the next few weeks.

Hicks, 29, a former model who joined Trump's 2016 presidential campaign without any experience in politics, became known as one of the few aides who understood Trump's personality and style and could challenge the president to change his views.

Her title belied the extent of her power within the West Wing — after John Kelly was appointed White House chief of staff, she had more access to the Oval Office than almost any other staff member. Her own office, which she inherited after the departure of another Trump confidant, Keith Schiller, was just next door.

Most significantly, Trump felt a more personal comfort with Hicks than he has established with almost any of his other, newer advisers since coming to Washington. And for a politician who relies so heavily on what is familiar to him, her absence could be jarring.

Hicks said that she had "no words" to express her gratitude to the president, who responded with his own statement.

"Hope is outstanding and has done great work for the last three years," Trump said. "She is as smart and thoughtful as they come, a truly great person. I will miss having her by my side."

But as the person who spent the most time with Trump, Hicks became enmeshed in a number of controversies over the past year, including key aspects of the investigations by Congress and the special counsel, Robert Mueller, into possible collusion between the Russian government and the Trump campaign.

Her resignation came a day after she testified for eight hours before the House Intelligence Committee, telling the panel that in her job, she had occasionally been required to tell white lies but had never lied about anything connected to the investigation into Russia's interference in the 2016 election.

And in recent weeks, her personal life drew attention when it was reported that she had dated Rob Porter, the White House staff secretary who resigned under pressure over allegations that he had abused his two former wives.

Multiple White House aides said that Hicks' leaving the White House was unrelated to her appearance before the House committee. They said that she had told a small group of people in the days before the session that she had planned to resign.

Among the things Hicks had advised Trump, according to multiple White House officials, was to tone down some of his Twitter posts or stop sending them altogether, an effort that had mixed results. She also had the ability to stop Trump from focusing on an issue he was angry about, and sometimes shield other members of the staff from Trump's anger.

While Hicks and Kelly developed a functional relationship, he considered her access to the president to be a challenge to the command-and-control system he tried to enforce, according to several White House aides.

But on Wednesday, Kelly echoed the president's praise.

"I quickly realized what so many have learned about Hope: She is strategic, poised and wise beyond her years," Kelly said. "She became a trusted adviser and counselor, and did a tremendous job overseeing the communications for the president's agenda including the passage of historic tax reform."

It was not immediately clear who will fill Hicks' role, although several White House officials and external advisers said they expect that Mercedes Schlapp — whom Kelly brought in as a ballast against Hicks' influence when he took over the job — will be elevated in some way.

Hicks' departure date was unclear, but it is likely to be in the next few weeks. She has not said what she will do next.