When Corey Lewandowski walked into Trump Tower on Monday morning, he was Donald Trump’s embattled campaign manager.

But before the morning was over he was out of a job.

Trump held a meeting at his headquarters in Trump Tower with Lewandowski, Trump’s children, campaign spokeswoman Hope Hicks, and campaign chairman Paul Manafort. As Lewandowski’s future with the campaign was discussed, Hicks—one of the original staffers and a Lewandowski loyalist—kept quiet, neglecting to stick up for her former ally. Trump’s daughter Ivanka had reportedly sat down with the real estate mogul recently and convinced him to let Lewandowski go.

Following the campaign’s daily 8:30 a.m. conference call, Lewandowski was escorted out of the building by security.

Lewandowski was, for many months, the least liked person in Trump’s orbit, so after Trump suffered arguably his worst month in the campaign—with his poll numbers tanking and his unfavorable numbers going to historic lows—it wasn’t a tough call who would pay the price.

“He’s an asshole, and just thank God he’s finally gone,” one campaign source told The Daily Beast. “People have been trying to stage coup after coup on Corey since the [Michelle Fields] incident, and it worked...finally.”

“It was just a matter of time,” a source close to the campaign said.

Lewandowski’s exit was swift and confirmed by Trump’s campaign shortly after the meeting.

“The campaign is grateful to Corey for his hard work and dedication and we wish him the best in the future,” spokeswoman Hicks said in a statement.

Reached on the phone moments after news of Lewandowski’s firing broke, Michael Cohen, Trump’s legal counsel, answered a call and whispered, “Yeah, I’m sorry, I’m just in the middle of a meeting at the moment so I can’t speak.” He abruptly hung up the phone.

But Trump’s problems in recent weeks went beyond his double-digit polling deficit to Hillary Clinton.

He repeatedly publicly insulted sitting Republican leaders, who want nothing more than for him to stop alienating various minority groups and act like a real candidate for president.

The presumptive Republican nominee failed so miserably at uniting the Republican Party that he faces a potential coup at the GOP convention in July from a group of delegates planning to vote against him.

Throughout the spring, the campaign split into warring factions: the political novice allies of Lewandowski on the one side, and on the other the seasoned operatives brought in by Manafort who were supposed to professionalize the organization.

Manafort’s team was accused of planting a story about Lewandowski in the New York Post hinting at an emotionally volatile, unprofessional relationship with Hicks. A GQ magazine profile of Hicks, released Monday—a few hours before Lewandowski’s firing—detailed their contentious relationship, including the fact that Lewandowski had cursed at her, saying, “you’re fucking dead to me,” and made her cry. According to The Guardian, Ivanka Trump had been unhappy with the conflict between Lewandowski and Hicks.

Veteran political adviser and Trump consigliere Roger Stone promoted Manafort, whom he had a lobbying firm with in the 1980s, from outside the campaign and had taken to calling Lewandowski “Loserdowski.” When it was reported that Lewandowski was in charge of vetting the vice presidential picks for Trump, Stone took to Twitter to say that it was complete hogwash, trying to delegitimize Lewandowski’s role even further.

Lewandowski did not respond to a request for comment from The Daily Beast.

Lewandowski, who had been hired in the winter of 2015 and outlasted other staffers who couldn’t tough it out in Trump’s competitive war room, appeared with the candidate as recently as this weekend, joining him for a campaign stop in Las Vegas. No one beyond the inner circle was aware this was coming down the pipeline.

Trump told Bloomberg Politics earlier this month: “Corey and Paul get along great. If they’re fighting, I get rid of one or the other or do something.”

But according to many former and current Trump staffers and advisers, that wasn’t the case.

“Corey is a cover man and at times temperamental,” a senior staffer who was let go from the campaign earlier this year told The Daily Beast.

When he heard the news of Lewandowski’s forced departure, he said, “Great news. A year too late.”

Trump trusted Lewandowski to a fault, keeping him around after a public fiasco in which the former campaign manager grabbed the arm of Fields (something that drew the ire of his daughter Ivanka). The candidate also often took Lewandowski’s advice at its word and hardly blinked an eye when stories about his unprofessionalism, particularly with women, surfaced in the media. Trump didn’t even seem to mind when Lewandowski was arrested and charged with battery over the Fields incident. (In the end the prosecutor in the case chose not to pursue the charges.)

According to a staffer in the campaign, last October social media manager Dan Scavino bought a new MacBook after being authorized to do so by Trump’s son-in-law, Jared Kushner. When Lewandowski found out, he “blew his stack” at Scavino, one telling sign of his short fuse.

In one instance, however, Lewandowski did acknowledge that he may have caused some problems for the campaign.

“He admitted on one of the conference calls that he apologized for becoming a distraction,” a former staffer said in the immediate aftermath of the night where Lewandowski grabbed Fields’s arm.

But in the end, it appeared Lewandowski’s biggest misstep was crossing Manafort. Some staffers learned the news of the firing only after it had happened Monday morning. But for many months, it seemed likely that Manafort would have his way—and that meant Lewandowski’s head.

“Manafort is a brutal man. If you’re in his way and he thinks you’re wrong,” one source close to the campaign said, “he will destroy.”

In April, Manafort called a meeting in Trump Tower to address the already troubled operation. Even then, he threatened to jump ship if he didn’t end up having his way in the ongoing war.

“He obviously joined thinking he’d have more ear and compliance from Trump. Wrong!!” a source close to the Trump campaign said at the time. “And Corey ain’t letting Manafort get a toehold.”

One senior adviser pointed to the fact that the two arms of the campaign, one based in Washington, D.C., and the other in the central nervous system of Trump Tower in New York City, were simply not communicating about everything that was going on day-to-day.

“You have people up in New York who have not done a presidential campaign. The folks down in D.C.,” the adviser told The Daily Beast, “they’re folks that have done several of them.”

For some, the joy couldn’t be contained when Lewandowski met his end with the Trump campaign.

New York state campaign director Michael Caputo tweeted, “Ding dong the witch is dead,” moments after the news was announced.

—Asawin Suebsaeng contributed reporting

Updated 1:19pm 6/20.