Washington (CNN) President Donald Trump took to Twitter on Monday to condemn former Secretary of State John Kerry for engaging in "shadow diplomacy" to try to preserve the Iran nuclear deal by holding meetings and speaking with major players, who, like Kerry, do not want Trump to withdraw the US from the agreement.

Kerry met with Iranian Foreign Minister Javad Zarif at the United Nations in New York two weeks ago, their second meeting in about two months, to discuss ways of keeping the deal limiting Iran's nuclear weapons program intact, according to two sources familiar with the interactions.

The former secretary of state also met last month with German President Frank-Walter Steinmeier, separately sat down with French President Emmanuel Macron and spoke on the phone with European Union foreign policy chief Federica Mogherini, the sources told CNN.

The Boston Globe was first to report Kerry's meetings with Zarif, Steinmeier and Mogherini.

Trump slammed Kerry's reported engagement on Monday.

"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 tweeted.

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! — Donald J. Trump (@realDonaldTrump) May 7, 2018

But a Kerry spokesman pushed back against Trump's remarks in a statement on Monday.

"I think every American would want every voice possible urging Iran to remain in compliance with the nuclear agreement that prevented a war. Secretary Kerry stays in touch with his former counterparts around the world just like every previous Secretary of State," said the spokesman in a written statement. "Like America's closest allies, he believes it is important that the nuclear agreement, which took the world years to negotiate, remain effective as countries focus on stability in the region."

Kerry's interactions with Iranian officials won't affect the Iran nuclear deal, the White House said on Monday.

"I don't think it impacts it at all. The President spoke out about that pretty clearly, and I don't think that we would take advice from somebody who created what the President sees to be one of the worst deals ever made," press secretary Sarah Sanders said. "I'm not sure why we would start listening to him now."

Kerry has also quietly lobbied members of Congress, including House Speaker Paul Ryan, placing dozens of phone calls in recent weeks.

Professor Saikrishna Prakash, who teaches constitutional and foreign relations law at the University of Virginia School of Law, said the 200 year-old Logan act is not something that is prosecuted.

"Both sides just trot this out whenever the other side has some sort of communication with a foreign government," he noted. "It's more a political charge than it is anything serious."

Prakash says there are two reasons the Justice Department would be weary of going after Kerry. First, it risks drawing additional attention to alleged violations by members of the Trump administration during the transition, and second, if the charges don't stick they could have "egg on their faces."

"It's definitely a political football," Prakash said.

During his Friday speech to the National Rifle Association, Trump attacked Kerry for his initial role in negotiating the Iran deal, which Trump called "horrible."

"And we have the former administration as represented by John Kerry, not the best negotiator we've ever seen," Trump said. "He never walked away from the table, except to be in that bicycle race where he fell and broke his leg."

The Trump administration faces a May 12 deadline to decide whether to continue waiving sanctions on Iran that were lifted under the 2015 Iran deal, formally known as the Joint Comprehensive Plan of Action.

Trump tweeted Monday that he "will be announcing my decision on the Iran Deal tomorrow from the White House at 2:00 pm."