ISTANBUL — From the start of Syria’s civil war, rebels fighting President Bashar al-Assad have had no better ally than Turkey’s prime minister, Recep Tayyip Erdogan. He has effectively kept Turkey’s border with Syria open, allowing fighters a haven in the south of his country as weapons, cash and other supplies have flowed to the battlefield.

He has even fired on Mr. Assad’s forces.

But now, Turkey finds itself in the same position as many of the rebels’ early backers, including the United States — concerned that Islamist radicals have come to dominate the ranks of the Syrian opposition. It shelled rebel positions this week for the first time since the war started, in yet another positive turn for Mr. Assad, who has found his position increasingly stable, if not secure.

Mr. Erdogan was one of the first world leaders to call for Mr. Assad to step down, and from the start he provided a lifeline to the rebels. But with radical Islamists controlling territory along the Turkish border, and the United States working with the Assad government to rid it of chemical weapons, his policy is in turmoil and his country without a viable ally in Syria. Mr. Erdogan has himself been criticized for allowing weapons to get into the hands of jihadists.

The shelling of rebel positions this week “was a signal that they wanted to show everybody that they wanted to take a different line on this,” said Henri J. Barkey, an expert on Turkey and a professor of international relations at Lehigh University. “It’s just symbolic. It’s a way of telling the rest of the world that we are taking a stand against these Al Qaeda-type guys.”