BEIJING — The missiles were being prepared even before the two men finished dinner, disrupting the carefully choreographed proceedings.

The American attack on Syria on Thursday unraveled China’s well laid plans for a summit meeting that would present President Xi Jinping as a global leader on par with President Trump, at once stealing the spotlight from Mr. Xi and putting him in a difficult position: choosing between condoning the kind of unilateral military action that China has long opposed, or rebuking his host.

Mr. Xi’s dilemma was also acute because China has generally sided with Russia in defending Syria’s president, Bashar al-Assad, and because it worries that Mr. Trump might be prepared to order a similar strike on North Korea, Chinese and Western analysts said.

“Xi can’t fail to be impressed by Trump’s resolve,” said Alan Dupont, an Australian military analyst who worked for that country’s Defense Department. “Xi will have to reassess what the Trump presidency means for Chinese interests in East Asia, particularly North Korea and the South China Sea.”