Trump says John Kerry should be prosecuted under the Logan Act. Kerry isn’t having it.

Former Secretary of State John Kerry hit back at President Donald Trump’s demand that he be prosecuted for allegedly urging Iran “not to call” the president.

Trump pressed the issue on Thursday, after insinuating to reporters that the United States could face a military confrontation with Iran.

The United States has “one of the most powerful ships in the world that’s loaded up,” Trump said, before accusing Kerry — who was secretary of state under former president Barack Obama — of impeding current diplomatic efforts.

Specifically, Trump accused Kerry of violating the Logan Act, a federal law that bans private citizens from contacting foreign governments or their representatives on behalf of the U.S. government without authorization.

“What I’d like to see with Iran, I’d like to see them call me,” Trump said. “You know, John Kerry speaks to them a lot. John Kerry tells them not to call. That’s a violation of the Logan Act. And frankly, he should be prosecuted on that. But my people don’t want to do anything that’s — only the Democrats do that kind of stuff. If it were the opposite way, they’d prosecute him, under the Logan Act,” Trump said.

“He’s talking to Iran, and has been. Has many meetings, and many phone calls — and he’s telling them what to do,” the president added.

Through a spokesman, Kerry shot back. “Everything President Trump said today is simply wrong, end of story,” Matt 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. Secretary Kerry helped negotiate a nuclear agreement to solve an intractable problem,” he continued.

“The world supported it then, supports it now. We’d hope the president would focus on solving foreign policy problems for America instead of attacking his predecessors for theater.”

Trump has criticized Kerry for meeting with Iranian officials before, and has accused him of having violated the Logan Act during those meetings.

Last September, Kerry said he has met with Iranian Foreign Minister Javad Zarif “three or four times” since leaving office. He defended those meetings, saying he’s simply staying in touch with his counterparts the way other former secretaries of state have done. Trump failed to produce any evidence Thursday that Kerry is interfering with U.S. diplomacy.

And the president’s accusation raises a thorny issue, by implying he’s had a change of heart about the Logan Act.

Michael Flynn, Trump’s former national security adviser, left the administration in January 2017 after it was revealed that he lied to investigators about meeting with Sergey Kislyak, then Russia’s ambassador to the United States, before Trump officially took office.

Flynn held the meeting in December 2016 — while Obama was still in office, but after Trump won the September 2016 presidential election — to urge the ambassador not to retaliate against new U.S. sanctions against Russia.

At the time, Trump didn’t seem to mind that Flynn — at the time, a private citizen — had met with the Russian ambassador to discuss U.S. foreign policy.

“Mike was doing his job,” Trump said. “He was calling countries and his counterparts. So, it certainly would have been OK with me if he did it. I would have directed him to do it if I thought he wasn’t doing it.”

If the Logan Act applies to Kerry — and again, Trump pointed to no evidence that Kerry is preventing Iran from calling U.S. officials — it certainly would have applied to Flynn as well.

The Trump administration has not made diplomacy with Iran a priority in its foreign policy. Last May, it withdrew from the 2015 Iranian nuclear agreement, an agreement struck between Iran, the United States, the United Kingdom, France, Russia, China, and Germany.

Since then, the administration has reimposed sanctions and threatened European allies still doing business with Iran. On Wednesday, the Iranian government announced that it would not comply with certain parts of the nuclear agreement, which many experts and foreign leaders noted was a predictable response to the U.S. decision to violate the deal one year ago.

Read more: thinkprogress.org