Donald Trump parted ways on Monday with his campaign manager, Corey Lewandowski, who has been a magnet for controversy and acrimony within and outside of the campaign.

The shakeup, first reported by The New York Times, comes as Trump is stumbling into the general election and his matchup with Hillary Clinton. The celebrity businessman has struggled to crack 40 percent nationally in public polling, and his recurring controversial remarks have panicked Republican leaders and party donors, even reviving chatter of a coup at the convention next month in Cleveland.

“The Donald J. Trump Campaign for President, which has set a historic record in the Republican primary having received almost 14 million votes, has today announced that Corey Lewandowski will no longer be working with the campaign,” Trump campaign spokeswoman Hope Hicks said in a statement to the Times. “The campaign is grateful to Corey for his hard work and dedication and we wish him the best in the future.”

Lewandowski’s departure, a move Trump had previously resisted, signals a shift in strategy for the campaign. It would also seem to settle a heated internal power struggle within the Trump camp between Lewandowski and Paul Manafort, the experienced GOP hand who was hired by Trump in April and quickly became his top adviser, overtaking Lewandowski.

Driving the rivalry has been a sharp contrast in strategy. Manafort has sought to assure Republicans that Trump would amend his bombastic style for the general election; Lewandowski, meanwhile, has urged the mantra “Let Trump be Trump.”

The departure draws to a close the remarkable, fraught journey of a first-time campaign manager steering his unconventional candidate to victory in one of the most competitive Republican presidential primaries ever.

When Trump first met with Lewandowski in December 2014, the latter was a New Hampshire-based Republican operative with a spotty resume. But Trump hired him immediately to run the nascent campaign.

“We hit it off, and if you don’t hit it off with your campaign manager, you have a problem,” Trump told the Washington Post later of that first meeting.

But Lewandowski quickly developed a reputation as a polarizing figure who sought to consolidate his power within the campaign. He acted as a gatekeeper to Trump even among aides and traveled constantly with the candidate, a role usually more in line with a “body man” than a campaign manager.

If he was a controversial figure within the campaign, Lewandowski also became the focus of public controversy in March, when Michelle Fields, then a reporter for Breitbart, accused him of grabbing her arm and nearly pulling her to the ground as she tried to ask Trump a question at a campaign event.

Even as Lewandowski was initially charged with battery in the incident, Trump cast aspersions on Fields’ account and publicly defended his campaign manager.

“Folks, look, I'm a loyal person,” Trump explained at a Wisconsin town-hall event in early April. “I'm going to be loyal to the country.”

But the controversy proved a major distraction for Lewandowski and the campaign. “He wasn’t quite as effective for the past couple of months,” Trump said later in April, after the Palm Beach, Fla., state’s attorney declined to prosecute the top aide.

Afterward, Lewandowski’s role within the campaign appeared to diminish. In May, the Washington Post reported that he would lead the search for a running mate; shortly thereafter, the campaign announced that Manafort would be promoted to campaign chairman.

Now, Lewandowski’s departure will leave Manafort as the clear top adviser to Trump heading into a potentially make-or-break stretch in the campaign.