Tulsi Gabbard, the director of national intelligence and an advocate of a more restrained foreign policy, submitted a letter of resignation to President Trump on Friday, saying that she was stepping away to support her husband after he recently was diagnosed with a rare form of bone cancer.

The departure will bring an end to Ms. Gabbard’s rocky tenure overseeing the 18 U.S. intelligence agencies, during which she had been largely sidelined by the White House on significant national-security issues, including military operations in Iran and Venezuela.

Mr. Trump assembled a second administration last year with an unusual mix of foreign-policy hawks in one corner and critics of American entanglements overseas like Ms. Gabbard in the other. But Ms. Gabbard and her wing found themselves increasingly marginalized in recent months, and her departure marks the most significant exit yet from the coalition of restrainers.

In her letter Friday, Ms. Gabbard, 45, said she would remain in her post as the nation’s intelligence chief until June 30.

“My husband, Abraham, has recently been diagnosed with an extremely rare form of bone cancer,” Ms. Gabbard said in her resignation letter, a copy of which was released by her office. “He faces major challenges in the coming weeks and months. At this time, I must step away from public service to be by his side and fully support him through this battle.” Ms. Gabbard has been married to Abraham Williams, a cinematographer, since 2015.

Mr. Trump announced that Aaron Lukas, Ms. Gabbard’s deputy, would serve as acting director of national intelligence.

It was not clear whom Mr. Trump intended to nominate to replace Ms. Gabbard, a combat veteran and former Democratic congresswoman from Hawaii who ran for president in 2020 before breaking with her party to support Mr. Trump in 2024.

Mr. Trump did not force Ms. Gabbard to resign on Friday, according to people familiar with the matter, but her standing and influence within the White House had continued to erode in recent months.

In a post on Truth Social, Mr. Trump thanked her for her service in the administration. “Tulsi has done an incredible job, and we will miss her,” he wrote.

Democrats, while expressing sympathy for Ms. Gabbard and her husband, made clear they had been dismayed by her performance. “Let’s be clear: Donald Trump must not treat this vacancy as another opportunity to reward loyalty over competence,” Senator Chuck Schumer of New York, the minority leader, said in a statement.

Ms. Gabbard had been a controversial figure in the Trump administration. She was seldom seen in the room when Mr. Trump made major national-security decisions and was widely viewed within the administration and by lawmakers in Congress as not a key member of the president’s team.

Her problems began soon after she was narrowly confirmed to the job last year following an especially contentious confirmation hearing. Several Republican senators joined Democrats in aggressively questioning her about some of her past views, including her defenses of the former intelligence contractor Edward Snowden and Bashar al-Assad, the former Syrian dictator.

As a fierce critic of the war in Iraq, Ms. Gabbard was closely aligned at times with Vice President JD Vance. But that put her out of step with Mr. Trump and many of his most influential advisers, including Secretary of State Marco Rubio and Stephen Miller, the White House deputy chief of staff, who pressed for an increasingly aggressive foreign policy in Latin America and Iran.

Despite conflicting foreign policy views, Ms. Gabbard at times managed her relationship with Mr. Trump, and won support from him with her work on election security and her surprise appearance early this year at an F.B.I. seizure of 2020 vote ballots in Georgia.

And Ms. Gabbard pleased Mr. Trump with her criticism of Obama-era investigations of Russia election meddling. “She’s, like, hotter than everybody. She’s the hottest one in the room right now,” Mr. Trump said last July, after Ms. Gabbard amplified without evidence claims that the Obama administration had deliberately overstated Russia’s interference in the 2016 election.

The praise came just weeks after Mr. Trump excoriated Ms. Gabbard over a video she had filmed during a trip to Asia that he saw as self-promotional, according to two people with knowledge of what had happened.

But as she variously pleased and disappointed Mr. Trump, Ms. Gabbard quickly developed a strained relationship with the C.I.A. as well as the broader U.S. intelligence community, according to current and former American officials. She presided over significant turnover at her agency headquarters in Liberty Crossing, Va., and supported efforts by Mr. Trump to rescind security clearances of intelligence officials viewed by the president and his allies as either disloyal or corrupt.

Mr. Trump had given Ms. Gabbard a mandate to shrink the size of her office, and she pursued that with vigor. She slashed the Foreign Malign Influence Center, which tracked adversarial efforts to interfere in American politics, and made other changes.

But her diminished stature in the administration became more visible in recent months. During the planning for the attacks on Iran and the January military raid to seize President Nicolás Maduro of Venezuela, it was the C.I.A. director, John Ratcliffe, who emerged as the most influential voice on intelligence matters. When Mr. Trump’s closest advisers met, it was Mr. Ratcliffe who delivered the intelligence assessments, not Ms. Gabbard.

Tensions between the C.I.A. and the Office of the Director of National Intelligence, which was created after the Sept. 11 terror attacks in 2001 to ensure better coordination of U.S. intelligence, rose throughout Ms. Gabbard’s 15-month tenure because of what some intelligence officials saw as political stunts. She stripped the security clearance of a senior C.I.A. officer who had been tapped for an overseas assignment. She ousted some respected career C.I.A. officers from posts held within her office.

There were also turf battles. Ms. Gabbard sought to move production of parts of the President’s Daily Brief — a daily compendium of the most important intelligence insights generated by U.S. spy agencies — from C.I.A. headquarters to her own. While Ms. Gabbard’s office oversees the brief, much of the work of pulling together the material for the president and other senior leaders is done at the agency.

Ms. Gabbard also was in a dispute with the F.B.I. about whether her office should have ultimate oversight over counterintelligence efforts, for which the bureau has long had primary responsibility. F.B.I. leaders also were upset by the efforts of Joe Kent, the former director of the National Counter Terrorism Center and a close aide to Ms. Gabbard, to investigate the killing of Charlie Kirk, the conservative activist.

Mr. Kent stepped down in March, citing his objections to the Iran war. Another ally, Amaryllis Fox Kennedy, announced this month that she was leaving her post in Ms. Gabbard’s office and another position at the White House. The departures fueled speculation that Ms. Gabbard could soon be next to go.

Olivia C. Coleman, a spokeswoman for Ms. Gabbard, challenged accounts that Ms. Gabbard had been at odds with the White House.

Ms. Gabbard will be the fourth cabinet member of Mr. Trump’s second term to step down, following former Attorney General Pam Bondi, former Homeland Security Secretary Kristi Noem, and former Labor Secretary Lori Chavez-DeRemer. All four of them are women.

On Friday, she submitted her resignation and signed it: “With love and aloha.”

Tyler Pager contributed reporting.