President Trump said Monday that Iran appeared to have been responsible for the weekend attack on Saudi Arabian oil facilities. But he also said he would “like to avoid” a military conflict with Tehran, emphasized his interest in diplomacy and played down the attack’s jolt to the global oil market.

Asked at the White House whether Iran was behind the strikes on Saturday that crippled much of Saudi Arabia’s oil output, Mr. Trump said, “It’s looking that way.” But he stopped short of a definitive confirmation, adding, “That’s being checked out right now.”

The attack was the most destructive blow to Saudi Arabia since it began waging war in Yemen more than four years ago. The damage inside Saudi Arabia helped drive world oil prices up by 10 percent on Monday, the fastest rise in more than a decade.

Mr. Trump warned that the United States has fearsome military capabilities and is prepared for war if necessary. “With all that being said, we’d certainly like to avoid it,” he said. “I know they want to make a deal,” he said of Iranian officials, whom he has been trying to draw into talks over their nuclear program and other issues. “At some point it will work out.”