The United States denied threatening the family of executed reporter James Foley with prosecution had they raised a ransom for his release, insisting the government did everything possible to bring him home.

Foley’s mother, Diane, had told US media her family was warned it could be charged if it had tried to raise the money to free their son.

“We were just told to trust that he would be freed somehow, miraculously,” Foley’s mother said on CNN. “And he wasn’t, was he?”

Spokesman Josh Earnest said the White House had been “in regular touch with the Foley family” to give updates and to communicate that the captured reporter’s “return and his rescue continued to be a priority of this administration.”

But Diane Foley said she felt the family’s “efforts to get Jim freed were an annoyance” to the US government, adding “it didn’t seem to be in our strategic interest, if you will.”

Earnest said long-standing US policy forbids paying ransoms, because doing so “only puts other Americans in a position where they’re at even greater risk.”

He referred questions about whether the Foleys would have been prosecuted to the Justice Department.

But he said Obama used “every tool at our disposal” to try to free Foley, including a “high-risk” military rescue attempt.

Secretary of State John Kerry also responded to the remarks, saying he was “really taken aback,” and that he was “totally unaware and would not condone anybody” at the State Department making any threatening statements.

“I and others in the government worked as hard as we know how to reach out to country after country — dozens of countries were talked to in an effort to try to create some avenue of success,” Kerry said.

“Tragically, obviously, we were not successful in finding them. So my heart goes out to the family.”

State Department spokeswoman Marie Harf said officials worked “to help the family understand what our laws are about… paying ransom to terrorists.”

However, “this department would never, and did not ever, intend to, nor do we think we ever did anything that we would consider threatening,” she insisted.

The 40-year-old freelance reporter’s death was revealed August 19 in a video released by Islamic State militants, in which he is seen being beheaded.

IS said his killing was in response to US air strikes. A week later it released a second video showing the beheading of another American journalist, Steven Sotloff.

Foley had covered wars in Afghanistan, Libya and Syria and contributed to GlobalPost, Agence France-Presse and other outlets. He was seized by armed men in northern Syria in 2012.