“The fact that this thing was able to slip through the American line of defense and then through the Saudi line of defense and hit with the precision that it did, frankly, it was an eye-opener,” he said. “So the question is can you get into a war today when you are not sure what the Americans will do?”

Both Prince Mohammed and Mr. Pompeo sought on Wednesday to frame the attack as the world’s problem.

In a phone call with the president of South Korea, Prince Mohammed called the attack “a true test of international will to confront sabotage that threatens international security and stability.”

In comments to reporters after a flight to Jeddah, Saudi Arabia, where he met with Prince Mohammed, Mr. Pompeo accused Iran of having carried out the strikes.

“We were blessed there were no Americans killed in this attack,” he added, “but anytime you have an act of war of this nature, there’s always a risk that could happen.”

Instead of threatening a military response, Mr. Pompeo spoke of assembling an international coalition to deter further strikes, without specifying who it would include and what it might do.

“That’s my mission here, is to work with our partners in the region,” he said. He spoke of working with European countries and planned to visit the United Arab Emirates, a close Saudi ally, before returning to Washington.

The State Department said in a statement after their meeting that Mr. Pompeo and Prince Mohammed had “agreed that this was an unacceptable and unprecedented attack that not only threatened Saudi Arabian national security, but also endangered the lives of all the American citizens living and working in Saudi Arabia, as well as the world’s energy supply in general.”