WASHINGTON—U.S. and Saudi military forces and their elaborate air-defense systems failed to detect the launch of airstrikes aimed at Saudi Arabian oil facilities, allowing dozens of drones and missiles to hit their targets, U.S. officials said.

Saudi and U.S. focus had been largely on the kingdom’s southern border with Yemen, where Riyadh has been fighting Iranian-backed Houthi rebels in Yemen’s civil war, the officials said. The attacks, however, originated from Iranian territory in the northern Persian Gulf, people familiar...