TEL AVIV—Iran launched a wave of more than 300 drones and cruise and ballistic missiles toward Israel, setting up a direct military confrontation between the two nations and raising the risks of wider regional war.

Dozens of drones and the vast majority of missiles fired by Iran were shot down by Israeli, American and other allied forces before reaching Israeli territory, Israeli and U.S. officials said.

Only a small number of missiles landed in Israel, causing minor damage to a military base in the southern part of the country, the military said. Orders for Israelis in the Golan Heights in the north and several cities in the south to remain in bomb shelters were lifted before dawn, and Israel reopened its airspace a few hours later, a sign the military believed the brunt of the attack to be over.

Iran and Israel have been engaged in a shadow war for decades, but direct military confrontation has been rare. This is the first time Iran has directly attacked Israel from Iranian territory.

Air-raid sirens began sounding across Israel in the early hours of Sunday morning, including in Jerusalem and the south of the country. Sirens were also activated in the West Bank. A young child was being treated for serious injuries from the attack, Israeli medical authorities said.

Iran’s attack involved more than 170 ballistic missiles, more than 30 cruise missiles and 170 drones, Israeli military spokesman Rear Adm. Daniel Hagari said. It began with the launch of dozens of drones, which appeared to be an effort to overwhelm Israel’s air defenses. Israel scrambled dozens of planes to help repel the attack.

“This is a severe and dangerous escalation,” Hagari said as it unfolded.

The U.S. military, which repositioned aircraft and missile-defense resources to the region in anticipation of an Iranian attack, helped shoot down Iranian drones and missiles headed for Israel, President Biden said late Saturday after a call with Israeli Prime Minister Benjamin Netanyahu .

Saturday’s attack—which Biden said also involved Iranian proxies operating in Yemen, Syria and Iraq—could trigger an Israeli response and threatens to take the Middle East to the brink of war.

“Whoever harms us, we will harm them,” Netanyahu said Saturday night in a video as the attack got under way.

Iran’s Islamic Revolutionary Guard Corps said late Saturday they would retaliate against the U.S. or any country in the region that helps Israel retaliate against Tehran.

United Nations Secretary-General António Guterres condemned Iran’s attack as a serious escalation and called for an immediate cease-fire.

“I am deeply alarmed about the very real danger of a devastating regionwide escalation,” Guterres said, adding, “neither the region nor the world can afford another war.”

Earlier in the day Biden returned to the White House where he met with his top national security advisers. U.S. National Security Council spokesperson Adrienne Watson said Biden’s team was in constant communication with Israeli officials as well as other partners and allies.

Iran’s arsenal of drones, cruise missiles and ballistic missiles has long concerned Israel and the West. Israel’s multilayered aerial-defense system has shown itself capable of defending the country against individual or small volleys of incoming drones and missiles. But officials and analysts say it could potentially be overwhelmed by a sufficiently large swarm of drones or a massive missile barrage.

“If they send many, they can saturate the system,” said Yehoshua Kalisky, a weapons-systems researcher at the Tel Aviv-based Institute for National Security Studies.

Iran’s use of ballistic missiles against Israel in this weekend’s attack showcases the regime’s military capabilities. Iran has the largest ballistic missile capability in the Middle East, largely homegrown, with U.S. officials estimating it has over 3,000 of the missiles, which are powered by rockets initially but then fall unpowered to hit their targets.

Ultimately, none of the drones or cruise missiles made it into Israel, Hagari said.

“The Iranian attack as it was planned was thwarted,” he said.

Iran had vowed to respond in kind to the attack earlier this month on the consulate in Damascus, which killed Gen. Mohammed Reza Zahedi, who according to Iranian state media and U.S. officials managed Iranian paramilitary operations in Syria and Lebanon.

Israel hasn’t claimed responsibility for the attack, but has long accused Iran of threatening its national security through allied militias, particularly from Lebanon and Syria, and called on the U.S. and European countries to do more to contain Iran’s military reach in the region.

In recent days, the U.S. had warned that an attack by Iran or one of its militia allies was imminent, and warned Tehran that it would defend Israel in the case of a conflict.

Bracing for an Iranian response, Israel on Saturday updated its emergency guidelines for civilians for the first time since the Damascus strike. Israel closed schools across the country until Tuesday and limited gathering sizes, although antigovernment protesters congregated in Tel Aviv on Saturday evening.

After the attack was launched, Israel’s military told residents in the northern Golan Heights and southern cities of Nevatim, Dimona and Eilat to stay near bomb shelters. Nevatim is home to one of Israel’s largest air bases and Dimona is located near Israel’s main nuclear research center.

Early Saturday, the Iranian navy seized an Israeli-linked containership sailing under a Portuguese flag in the Strait of Hormuz, indicating one type of measure Tehran might take in the coming days.

Ships sailing in the Eastern Mediterranean, the Persian Gulf and the Red Sea have been warned of the Iranian drone attack and advised to divert, according to brokers and shipowners.

“We stopped and we are waiting for day break ,” said Gabriel Garcia, the executive officer of a European-owned tanker in the Red Sea. “We don’t know where these drones will end up and there are also warnings of possible Houthi attacks.”

There are more than 200 commercial ships sailing in the three waterways.

Warning that an Iranian attack could be imminent, the U.S. on Friday rushed warships into position to protect Israel and American forces in the region, hoping to head off a direct Iranian attack on Israel that could spark a wider conflict in the Middle East.

In Iran, pressure has been building on the leadership to respond to the Syria strike, both from hard-liners bent on avenging one of the most serious attacks on Iranian personnel in recent years, and from parts of the public who want the military to stand up to Israel.

In recent days, some Iranians have begun mocking the military and the leadership for not taking action despite numerous threats, including by Iranian Supreme Leader Ali Khamenei , to avenge the strike in Damascus.

“Israel, they don’t have the balls to seek revenge,” read a fresh piece of graffiti on a wall in Tehran, referring to the government. “Hit them harder next time, Israel, they have wet their pants,” read another.

Other residents of Tehran said they were mostly worried that a conflagration with Israel would pile further pressure on the country’s sanctions-squeezed economy and questioned the value of spending billions of dollars on foreign military ventures if the country can’t defend itself against Israeli attacks.

Iranian state news agency IRNA said the Islamic Revolutionary Guard Corps’ naval forces in the Strait of Hormuz had boarded the Portugal-flagged MSC Aries by helicopter and were directing it to Iranian territorial waters.

The Aries is connected to a London shipping company controlled by an Israeli family. The incident marked the first time Iran has seized a large ship since January. MSC, the Greek company managing the Aries, confirmed the vessel had been seized, adding that the ship had 25 crew members on board and that it was “working closely with the relevant authorities to ensure their well-being, and safe return of the vessel.”

The Portuguese Ministry of Foreign Affairs said there were no Portuguese citizens onboard the MSC Aries but that it was monitoring the situation and had asked Iran for clarification about the incident.

Israel’s military was on high alert Saturday for a major attack by Iran or one the regional militias it arms and funds, such as the Lebanese group Hezbollah, which has been exchanging fire with Israel since October.

Israel’s military earlier in the day said it attacked a large Hezbollah military complex in Lebanon on Saturday morning, after more than 40 projectiles were launched across the Lebanese border into Israel on Friday night, according to the military.

The Israeli military also said it destroyed rockets in the Gaza Strip that it said were poised to launch at central Israel. Iran supports Hamas and other Palestinian militants in Gaza.

Write to Sune Engel Rasmussen at , Catherine Lucey at , Michael R. Gordon at and Dov Lieber at