On Thursday, President Donald Trump said former Secretary of State John Kerry “should be prosecuted” for his private discussions with Iran’s government.

Trump also accused Kerry of dissuading Iranian officials from talking to the White House.

“He’s talking to Iran and has been, has many meetings and many phone calls and he’s telling them what to do,” Trump claimed of Kerry. “And that is a total violation of the Logan Act.”

The Logan Act, which became law in 1799, prohibits private American citizens from entering into unauthorized deals with foreign governments. Only two individuals have ever been charged under this law. Ironically, some legal pundits have suggested Trump may have potentially violated the Logan Act during his 2016 campaign, when he urged Russia in a televised address to locate more than 30,000 missing emails belonging to Hillary Clinton. Several Democrats also brought up the Logan Act after it was revealed last year that Trump and many members of his transition team met with foreign dignitaries around the time of the 2016 election and the 2017 inauguration. 

While serving as Barack Obamas secretary of State from 2013 to 2017, Kerry was involved in the negotiations that led to the 2015 Iran nuclear deal. Late last year, Kerry revealed he has spoken with Iran’s Foreign Minister Mohammad Javad Zarif “three or four times” since leaving the White House.

SLIDESHOW: TOP DEMOCRATS RUNNING FOR PRESIDENT IN 2020

Trump withdrew from the Iran nuclear deal in May 2018, calling it one of “the worst trade deals” the United States ever made. The pact essentially eases sanctions on Iran in exchange for the country reducing its nuclear capabilities.

Kerry’s spokesman, Matt Summers, blasted Trump for grossly mischaracterizing Kerry’s discussions with Iran and for the president’s assessment of the nuclear deal.

“Everything President Trump said today is simply wrong, end of story,” Summers said in a statement. “He’s wrong about the facts, wrong about the law, and sadly he’s been wrong about how to use diplomacy to keep America safe.”

Earlier this month, the White House said it would send an aircraft carrier task force to the Persian Gulf as a response to potential targeting of American forces by Iran in that area. The administration did not specify a date for the move.