Leavitt welcomed her second child, a baby girl, with husband Nicholas Riccio in May. She also has a two-year-old son. She returned to work from maternity leave last month.
She wrote on X following the president's announcement that her job has been "the honor and adventure of a lifetime".
"Being a mother and welcoming a new baby while working in one of the most demanding jobs in the world has been the most rewarding yet challenging season of my life, to say the least," she wrote.
"The truth is since returning to the White House after the birth of my daughter, I have felt in my heart that I cannot be the best mom my two young children deserve while devoting the constant time, energy, and attention required of the White House Press Secretary - and that is why I have ultimately made the bittersweet decision to depart the White House and embark on a new chapter in my life," she continued.
Before her tenure at the White House as press secretary, she had a long career working with Trump, first as an assistant press secretary and speech writer during his first term in office.
She later went on to become a top aide to New York Republican congresswoman Elise Stefanik as communications director.
In 2022, Leavitt unsuccessfully ran for Congress in New Hampshire, emerging victorious from a contested Republican primary, but ultimately losing to Democrat Chris Pappas.
She later became a spokesperson for Maga Inc - a pro-Trump fundraising group - before joining his 2024 electoral campaign as national press secretary.
Leavitt has had a sometimes combative relationship with the media during her tenure, accusing some reporters of being biased or left-wing.
In February last year, her office seized control of the White House press pool, stripping organisational duties from the White House Correspondent's Association, as well as initially barring the Associated Press over its refusal to adopt the term "Gulf of America".
Among supporters of the Trump administration, however, she was widely praised for remaining "on message" and ferociously defending the president's policies.
"Watching it in person was even better than watching it online," Fox host and conservative activist Riley Gaines wrote on X after one particularly feisty briefing room exchange. "Karoline Leavitt is so good at her job."
She is the second longest-serving press secretary in either of Trump's administrations, following only Sarah Huckabee Sanders.
It is unclear who will now become Trump's sixth chief spokesperson across his two administrations.
During Leavitt's roughly seven-week maternity leave earlier this year, a series of senior Trump administration figures took the podium including Vice-President JD Vance, Secretary of State Marco Rubio, and Secretary of the Interior Doug Bergum.
The BBC has contacted the White House for comment on potential choices and the timeline of her replacement's selection.
Extracted and lightly reformatted for readability. · Source: pt
