Israel has been spying on nuclear talks between world powers and Iran, the Wall Street Journal reported on Monday. Israel later denied the allegation.

The US administration discovered the spying shortly after talks began between Tehran and the P5+1 powers, according to the report.

The intelligence-gathering was reportedly part of a broader Israeli effort to build a case against any emerging deal.

Jerusalem received information by listening in on the negotiations and confidential briefings, as well as speaking to informants and European diplomats.

But the White House was not especially perturbed by the spying itself, said senior US officials. It was only when the Netanyahu government used classified information to gain the support of US lawmakers, many in the administration felt a line had been crossed.

“It is one thing for the US and Israel to spy on each other. It is another thing for Israel to steal US secrets and play them back to US legislators to undermine US diplomacy,” a senior American official was quoted as saying.

The US spies on Israel as well. It discovered the Israeli espionage by listening in on conversations between Israeli officials, and determined insider information could only have come from Israeli spying.

US Secretary of State John Kerry is to return to Switzerland for talks Thursday with his Iranian counterpart, Mohammad Javad Zarif, on a deal to restrain Tehran’s nuclear program, according to his office.

Kerry’s return to Lausanne will again feed speculation that the top world powers represented on the P5+1 group — the US, Britain, France, Russia, China and Germany — are nearing an agreement with Tehran, with a March 31 deadline to agree to the outlines of a deal looming.

On Monday, Intelligence Minister Yuval Steinitz said a “bad deal” was likely to be the final outcome of the nuclear talks, as Israel made a last-ditch effort to head off the controversial high-stakes agreement.

Steinitz, in France for consultations about the emerging agreement, told Reuters that Israel would do all it could to toughen any accord before talks resume this week.

“We think it’s going to be a bad, insufficient deal,” Steinitz said before meeting French officials in Paris. “It seems quite probable it will happen, unfortunately.”

Unable to find support from its US allies, Israel is turning to France to help head off what it sees as a bad nuclear deal with Iran.

Paris has expressed skepticism over some of the terms of the deal.

Iran and the six-nation group hope to reach a rough deal by the end of March and a final, permanent agreement by June 30.

The talks seek a permanent deal to cap Iran’s nuclear program in exchange for the easing of economic sanctions.

Iran says its nuclear program is for peaceful purposes. The West fears it could allow Iran to build an atomic bomb.

AP and AFP contributed to this report.