A senior White House official, who asked not to be identified discussing internal dynamics, said Mr. Hagin had been repeatedly targeted by others in Mr. Trump’s orbit, both inside and outside the building, who questioned his loyalty given his ties to the Bush family. Mr. Trump beat Jeb Bush, the son of George Bush and brother of George W. Bush, with scathing attacks on him and his family to win the Republican nomination in 2016, and neither of the former presidents voted for him in the November election.

Mr. Trump has grown isolated within the West Wing, according to advisers, and is eager for human contact, even if that means jousting with the reporters whom he calls “fake news.” He often asks staff members about whether others are leaking, and he recently told one person that “the Bushies in the White House are out to get me,” according to someone with direct knowledge of the discussion.

Mr. Hagin said by email on Tuesday that “the Bush thing is overblown” and that his departure was unrelated and long planned. He said he had committed to stay just for a year and planned to leave at the start of 2018. “But Kelly pushed me to stay and I have great respect for him,” Mr. Hagin said, referring to John F. Kelly, the chief of staff. “Then the summit came up in the spring and I felt obligated to see that through.”

Mr. Hagin may be on the leading edge of a fresh wave of departures from a White House that has had record turnover. Among others who have been said to be considering leaving this year are Mr. Kelly; Donald F. McGahn II, the White House counsel; Marc Short, the legislative affairs director; Sarah Huckabee Sanders, the press secretary; Raj Shah, the top deputy press secretary; and Dan Scavino Jr., the social media director.

If Mr. Scavino departed, it would mark the end of an era for Mr. Trump, who has lost nearly all of the aides with whom he is most comfortable during the past year. Mr. Scavino was one of the campaign’s original small group of staff members, and he is the keeper of Mr. Trump’s Twitter feed when the president is not using it himself.