The White House kept it quiet until now, but on Friday the President nearly blocked the Vice President from getting his chosen national security adviser.

Why this matters: It's a highly unusual event, as Trump typically gives Pence a long leash on personnel appointments. This is the first time the President has tried to block Pence from filling a senior staff position. The scene also highlights — once again — the extraordinary importance Trump places on personal loyalty.

Inside the West Wing: Trump was furious when he learned Pence was bringing on Nikki Haley's deputy Jon Lerner, according to three sources familiar with the events. The President believed Lerner was a card-carrying member of the "Never Trump" movement because Lerner crafted brutal attack ads for Club for Growth's multimillion-dollar anti-Trump blitz during the Republican primaries.

"Why would Mike do that?" Trump wondered aloud about Pence's decision, according to two sources briefed on the President's private conversations.

Behind the scenes: Trump told Kelly to get rid of Lerner. On Friday, as turmoil unfolded, Pence's team was on the plane to Peru for the Summit of the Americas. Pence's team got wind of what was happening, and when Pence landed he called the President and talked him around on Lerner, according to administration officials familiar with the situation. Trump was in the Oval when Pence called.

Senior officials, including White House Counsel Don McGahn, were concerned about the logistics of Lerner dividing his time between Haley and Pence. The story in the Washington Post that broke the news of Lerner's appointment took White House officials by surprise.

Other officials question Lerner’s qualifications, describing him to Axios as a politico and a pollster, with little foreign policy experience. Pence's team argued internally that he'd done a great job for the past year working for Haley, has previously advised members of Congress on foreign policy and would be well-supported in Pence's office by subject matter experts.

The sources said Kelly told colleagues that Pence's chief of staff Nick Ayers, who orchestrated the appointment, had not "fully informed" him of Lerner's anti-Trump history. Ayers and Lerner have worked together in the past for Haley, among other campaigns.

The pushback: Ayers has told associates, however, that he briefed Kelly on Lerner and also looped in other senior officials including Haley, John Bolton and Mike Pompeo. Lerner's been serving as Haley's deputy and was in the room for a sensitive Syria briefing in the Situation Room on Thursday.

What's next: Pence and his team appear to have averted what would've been the VP's first personnel crisis. In the Pence team's eyes, it was a "minor confusion" that never should've escalated to the President and could've been resolved almost instantly had the Pence team not been on a plane when the drama was unfolding.

Get more stories like this by signing up for Jonathan Swan's weekly political lookahead newsletter, Axios Sneak Peek.