JERUSALEM >> Israel launched a series of airstrikes against Iran on Saturday, fulfilling its vow to retaliate for an earlier Iranian attack and raising fears that the intertwined conflicts in the Middle East could escalate into an all-out war between the region’s two most powerful militaries.

The Israeli military said in a statement at 2:30 a.m. that it was “conducting precise strikes on military targets in Iran,” adding that it was acting in response to more than a year of attacks on Israel by Iran and its allies across the Middle East.

Israel did not immediately say where or how the strikes were being carried out. Residents of Tehran, the Iranian capital, reported hearing multiple explosions in and around the city.

Maryam Naraghi, an Iranian journalist, said she heard large explosions in the eastern part of Tehran, where she lives. “It was the sound of bombs and explosions,” she said. “It was very close to where I am.” The area includes military bases and the secretive military site Parchin.

Another Iranian journalist, Reza Rashidpour, said five massive explosions were heard in Tehran within about 10 seconds. He said Iranian air force jets had taken off in the western part of the country.

The attack early Saturday was a response to several waves of ballistic missiles that Iran launched at Israel on Oct. 1, which forced millions of Israelis to take cover in bomb shelters but did minimal damage. “Iran made a big mistake tonight — and it will pay for it,” Israeli Prime Minister Benjamin Netanyahu said then.

Iran said it had fired the missiles at Israel in response to the killings by Israel of Hassan Nasrallah, the longtime leader of Hezbollah, and an Iranian Revolutionary Guard commander who was with him at the time; and Ismail Haniyeh, the Hamas leader, whose assassination while in Tehran was particularly embarrassing to the regime there.

The recent exchanges between Israel and Iran have bucked both countries’ long-standing practice of avoiding direct military clashes. For years, Israel and Iran have fought each other in a shadow war involving covert operations and armed groups backed by Iran, including Hamas and Hezbollah. But after the Oct. 7, 2023, assault on Israel by Hamas, the conflict between Israel and Iran came out into the open this year.

Before Saturday’s attack, the Israeli government had told the Biden administration that it would avoid striking Iran’s nuclear enrichment and oil production sites, two officials said earlier this month.

The officials, who spoke on the condition of anonymity to discuss sensitive diplomacy, said that Israel had agreed to focus its attack on military targets in Iran.

The White House believed that avoiding nuclear or oil infrastructure sites would reduce the likelihood of the United States being dragged into a bigger Middle East confrontation with the presidential election less than two weeks away.

Two classified U.S. intelligence documents that were leaked last week described satellite images of Israeli military preparations for a strike on Iran and offered insight into U.S. concerns about those plans.

President Joe Biden replied in the affirmative last week when asked whether he knew when Israel would strike, and what kind of targets it had chosen. He gave no details, but his response implied that the United States and Israel may have reached an agreement on the matter.

Secretary of State Antony Blinken held a lengthy meeting with Netanyahu on Tuesday.

Israel and Iran traded attacks earlier this year.