News of former Secretary of State John Kerry’s alleged collusion with the Iranian government played a role in President Donald Trump’s decision to scuttle the Iran deal, two White House sources with direct knowledge of the president’s thinking tell The Daily Caller.

Trump announced he was pulling out of the deal Tuesday, just a few days after news broke that Kerry had been parlaying with Iran in an attempt to keep the deal alive.

A source inside the White House with knowledge of the decision process tells TheDC that the Iran deal was “done” when Trump found out about Kerry’s lobbying behind the scenes. “Trump was headed that way but Kerry just took away any of the teeth of the detractors,” the source said on background. “[Kerry’s] bulls**t ultimately killed the deal.”

Another source inside the West Wing confirms to TheDC that there was a frantic last-minute lobbying effort to keep the deal in place and that the timing of the Kerry news was “ironic.” The source specifically blames Kerry’s meddling in the process as a key decision point in the calculus for pulling out of the deal.

“It was by no means the reason [Trump] decided to pull out, but it certainly influenced the final decision,” the source continued. “I mean, read the tweets.”

President Trump attacked Kerry’s actions on Twitter Monday, saying, “The United States does not need John Kerry’s possibly illegal Shadow Diplomacy on the very badly negotiated Iran Deal. He was the one that created this MESS in the first place!”

Trump followed up, saying, “John Kerry can’t get over the fact that he had his chance and blew it! Stay away from negotiations John, you are hurting your country!”

Both sources confirm that Kerry’s actions hurt the lobbying effort by some in the West Wing to keep the deal in place.

The decision marks another crippling blow to Barack Obama’s legacy by the Trump administration. The Iran deal was the cornerstone of Obama’s foreign policy.

It was revealed late last week that Team Obama was working furiously to keep their legacy accomplishment afloat. Kerry was revealed to be actively working with his Iranian counterparts to salvage the Iran nuclear deal and undermine the current administration in a report published by The Boston Globe Friday.

According to The Globe, Kerry met with Iranian Foreign Minister Javad Zarif multiple times over the last few months. He also reportedly met with German President Frank-Walter Steinmeier, French President Emmanuel Macron and multiple members of Congress.

A Kerry spokesperson told Fox News, “Secretary Kerry stays in touch with his former counterparts around the world,” and that he was working to make sure the tenants of the Iran deal “remain effective.”

The report comes as the Trump administration is under intense scrutiny for allegations that the president’s campaign colluded with Russia to swing the 2016 election. No evidence has yet been presented to support that claim.Some legal scholars say Kerry’s actions were a clear violation of the Logan Act.

The Logan Act states:

“Any citizen of the United States, wherever he may be, who, without authority of the United States, directly or indirectly commences or carries on any correspondence or intercourse with any foreign government or any officer or agent thereof, with intent to influence the measures or conduct of any foreign government or of any officer or agent thereof, in relation to any disputes or controversies with the United States, or to defeat the measures of the United States, shall be fined under this title or imprisoned not more than three years, or both.”

The Boston Herald has called for a full investigation into Kerry’s actions.

Kerry defended his stance by posting a statement on Twitter Tuesday. He complained that Trump’s decision “weakens our security” and “isolates us from our European allies and puts Israel at greater risk.”