Updated

President Trump and John Kerry entered into a war of words on Twitter Friday, with the president suggesting the former secretary of state had "illegal meetings" with the Iranian regime, and Kerry suggesting the commander-in-chief should be more concerned with the Russia investigation.

“John Kerry had illegal meetings with the very hostile Iranian Regime, which can only serve to undercut our great work to the detriment of the American people. He told them to wait out the Trump Administration! Was he registered under the Foreign Agents Registration Act? BAD!” Trump tweeted Thursday night.

The president’s tweet came amid Republican criticism for Kerry’s “shadow diplomacy” with Iran. Kerry admitted to having multiple meetings with Iranian officials behind the backs of Trump administration officials. Some of the meetings were in regards to the scrapped Iranian Nuclear Deal.

Kerry, later Friday, hit back, suggesting the president should be more concerned about the Russia investigation than his diplomatic meetings.

"Mr. President, you should be more worried about Paul Manafort meeting with Robert Mueller than me meeting with Iran's FM. But if you want to learn something about the nuclear agreement that made the world safer, buy my new book, Every Day is Extra," Kerry tweeted with a link to the Amazon page to the volume.

He added: "PS- I recorded the audio version, not Omarosa."

The tweet appeared the be a sarcastic reference to former White House aide Omarosa Manigault Newman's practice of recording conversations in the White House.

JOHN KERRY SLAMMED FOR 'SHAMEFUL' SHADOW DIPLOMACY AFTER ADMITTING TO MEETINGS WITH IRAN

The Foreign Agents Registration Act (FARA) is a disclosure statement that requires a person acting as an agent of a foreign principal in a political or quasi-political capacity to make public disclosure of their relationship with the foreign principal.

Kerry’s meetings do not appear to violate FARA, but some have suggested they could be in violation of the Logan Act, which prohibits private citizens from negotiating on behalf of the U.S. government without authorization, though no one has ever been successfully prosecuted under the law.

A spokesman for Kerry also defended the former secretary of state's actions.

"Let's cut through the distractions and talk about real facts, not alternative facts. Secretary Kerry stays in touch with his former counterparts around the world just like every previous Secretary of State, and in a long phone conversation with Secretary Pompeo earlier this year he went into great detail about what he had learned about the Iranian’s view," the Kerry spokesman said in a statement to Fox News.  "No secrets were kept from this administration. Like America’s closest allies, Kerry believes it is important that the commitments Iran made under the nuclear agreement, which took the world years to negotiate, remain effective. He was advocating for what was wholly consistent with US policy at the time."

The spokesman added: "There’s nothing unusual, let alone unseemly or inappropriate, about former diplomats meeting with foreign counterparts. Secretary Kissinger has done it for decades with Russia and China. What is unseemly and unprecedented is for the podium of the State Department to be hijacked for political theatrics."

Kerry, the former Massachusetts senator who worked as the nation’s top diplomat in the Obama administration, made the comments about his interactions with Iran as he promotes his new book, “Every Day Is Extra.”

During an appearance on Hugh Hewitt’s radio show Wednesday, Kerry acknowledged meeting with Iranian Foreign Minister Javad Zarif “three or four times” since leaving office, admitting to discussing the scrapped nuclear deal, among other issues.

“What I have done is tried to elicit from him what Iran might be willing to do in order to change the dynamic in the Middle East for the better,” Kerry said.

TRUMP SLAMS JOHN KERRY AS 'FATHER' OF IRAN DEAL AMID 2020 SPECULATION

Later Wednesday, during an appearance on Fox News’ “The Daily Briefing,” Kerry did not deny the suggestion he told Iranians to “wait out” Trump until the next Democratic president.

“I think everybody in the world is talking about waiting out President Trump,” Kerry said.

Kerry ran for president, unsuccessfully in 2004, and has not ruled out a 2020 bid.

Reports that Kerry met with Zarif first surfaced in May. The Boston Globe called the meeting an “aggressive yet stealthy” mission to put pressure on the Trump administration to keep the Obama-era nuclear deal in some form.

Trump, though, moved to scrap the deal, declaring the pact failed to halt the country’s nuclear ambitions. The Treasury Department last month restored sanctions against Iran.

Trump blasted Kerry for his “possibly illegal Shadow Diplomacy” earlier this year.

Kerry, though, denied his meetings were inappropriate.

“Every secretary of state, former secretary of state continues to meet with foreign leaders, goes to security conferences, goes around the world,” Kerry said on “The Daily Briefing.” “We all do that. And we all have conversations [about] the state of affairs with the world in order to understand them.”

Fox News’ Rich Edson and Alex Pappas contributed to this report.