As tensions with Iran escalate, President Trump accused a top Obama-era official, former Secretary of State John Kerry, of violating the law by talking with the Iranian government and said he should be prosecuted for allegedly advising the government in Tehran not to negotiate with the Trump administration.

"John Kerry speaks to them a lot," Mr. Trump told reporters at the White House Thursday, referring to the Iranian government. "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."

Mr. Trump's accusation comes as the relations between the governments in Washington and Tehran have become even more strained in recent weeks. The White House has threatened to impose new sanctions and sent an aircraft carrier to the Middle East to deter any possible attack with "unrelenting force."

Get Breaking News Delivered to Your Inbox

Kerry, who served as America's chief diplomat from 2013 to 2017, was one of the key architects of the Joint Comprehensive Plan of Action, known as the Iran deal, which was designed to make sure Tehran gradually eliminated its medium-enriched uranium stockpile in exchange for the lifting of economic sanctions. Although America's European allies are still abiding by it, Mr. Trump withdrew the U.S. from the agreement in May 2018, deriding it as a one-sided deal.

Since leaving office, Kerry has remained in contact with Iranian foreign minister Mohammad Javad Zarif.

On Thursday, the president repeatedly accused the former secretary of state of violating the Logan Act, a 1799 law that essentially bars private U.S. citizens from conducting diplomacy on behalf of the American government.

The obscure centuries-old law, which has rarely been used in prosecution, prohibits U.S. citizens from communicating with foreign governments "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."

Matt Summers, a spokesperson for Kerry, criticized Mr. Trump for making "false" statements about the former secretary of state and mischaracterizing U.S. law.

"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," Summers wrote in a statement to CBS News, referring to the president. "Secretary Kerry helped negotiate a nuclear agreement that worked to solve an intractable problem. The world supported it then and supports it still."

Asked about Mr. Trump's claims on Thursday, Iran's ambassador to the United Nations Majid Takht-Ravanchi told MSNBC he was unaware of Kerry ever instructing the Iranian government not to contact the White House.

"This is something new to us," Takht-Ravanchi said.

Margaret Brennan and Tony Cavin contributed to this report.