Iran is preparing to launch a ballistic missile attack against Israel, a senior White House official said Tuesday, in what would be a significant escalation that threatens to spark an all-out war in the Middle East that the Biden administration has desperately tried to avoid.

The expected barrage comes days after Israel killed Hezbollah leader Hassan Nasrallah and hours after the Israeli military confirmed a limited military operation inside Lebanon. The U.S. will help Israel defend itself against the expected strikes, the official said, similarly to how it shot down missiles and drones when Iran launched a major attack in April.

It’s unclear when Iran’s operation will exactly begin, but U.S. diplomatic personnel in Tel Aviv were told to shelter in place, according to people familiar with the matter. U.S. officials and analysts expected Iran would retaliate in some way as it is Hezbollah’s major patron, requiring it to respond or risk losing regional credibility.

“The United States has indications that Iran is preparing to imminently launch a ballistic missile attack against Israel,” the senior White House official said. “We are actively supporting defensive preparations to defend Israel against this attack. A direct military attack from Iran against Israel will carry severe consequences for Iran.”

The Iranian mission to the United Nations didn’t immediately respond to a request for comment.

Both the U.S. and Israel have said that an Iranian attack on Israel would have severe consequences for Tehran. During an address last week at the United Nations, Israeli Prime Minister Benjamin Netanyahu said, “if you strike us, we will strike you.”

On Monday, Netanyahu released an English-language video directed at Iranians, calling on them to rise up against their nation’s regime.

U.S. defense officials late Monday appeared to warn of a potential strike. During a call between Defense Secretary Lloyd Austin and his Israeli counterpart, Austin “made clear that the United States is well postured to defend U.S. personnel, partners, and allies in the face of threats from Iran and Iran-backed terrorist organizations, and determined to prevent any actor from exploiting tensions or expanding the conflict,” the Pentagon said in a statement.

The U.S. had already ordered additional military forces into the Middle East to help deter an Iranian attack and defend Israel. The Pentagon in the last few days sent additional air defense capabilities into the region, including boosting the number of fighter jets to help shoot down Iranian missiles, and directed an aircraft carrier, the USS Abraham Lincoln, to stay in the region instead of heading home as planned.

Michael R. Gordon, Nancy A. Youssef and Lara Seligman contributed to this article.

Write to Alexander Ward at alex.ward@wsj.com