The U.S. closely monitored Israel’s military bases and eavesdropped on secret communications in 2012, fearing its longtime ally might try to carry out a strike on Fordow, Iran’s most heavily fortified nuclear facility.

Nerves frayed at the White House after senior officials learned Israeli aircraft had flown in and out of Iran in what some believed was a dry run for a commando raid on the site. Worried that Israel might ignite a regional war, the White House sent a second aircraft carrier to the region and readied attack aircraft,...