Donald Trump’s national security adviser Mike Waltz and his deputy, Alex Wong, will be leaving their posts after they lost the confidence of other administration officials and found themselves without allies at the White House, according to two people familiar with the matter.

The exit of Waltz and Wong marked the conclusion of a fraught tenure. In March, Waltz inadvertently added Jeffrey Goldberg, editor-in-chief of the Atlantic, to a Signal group chat that shared sensitive information about US missile strikes in Yemen before they took place.

The president briefly considered firing Waltz over the episode, but reportedly decided he was unwilling to give the news media the satisfaction of forcing the ouster of a top cabinet official weeks into his second term. Trump was also mollified by an internal review that found Waltz’s error was a mistake