WASHINGTON — President Obama made the right decision to boost military aid to moderate Syrian rebels last year, but today America’s approach to attacking Islamic State fighters risks undermining the moderate opposition and alienating support among the Syrian public.

Last Friday, for the first time I can recall, opponents of the government of President Bashar al-Assad burned an American flag, and anti-American demonstrations mushroomed across opposition-held areas in Syria. These people have no love for the Islamic State, also known as ISIS, but this means something went seriously wrong with our initial campaign of airstrikes.

The rebels were furious that the Americans had not targeted the Assad government, which has killed far more Syrian civilians than the Islamic State has. Syrians perceive, wrongly, that the Americans and regional allies don’t care about the government’s atrocities, and are concerned only with the Islamic State. Our targeting of terrorist elements attached to the Nusra Front — the Syrian branch of Al Qaeda, which is fighting the Assad government — added to the rebels’ suspicion that the Americans were helping Mr. Assad as much as fighting the Islamic State.

Moderate armed opposition groups also looked foolish because the American side didn’t coordinate the strikes with them, even though we have worked with them before. An American journalist on the Turkish border told me last week that moderate rebels were briefed on the strikes only after most of us had already seen the video evidence via the Internet. We also made the moderate fighters appear naïve about working with us because the attacks didn’t much help their battles against the Islamic State in northern Syria.