ISTANBUL — Turkey’s Parliament on Thursday authorized further military action against Syria as Turkish forces fired a second round of artillery across the border, threatening to escalate a confrontation that has highlighted Turkey’s fraught double role as it tries to stay out of direct involvement in the fight against President Bashar al-Assad while offering haven and support to the rebels.

Turkey hit Syria after a mortar attack on Wednesday that killed five of its civilians. But the strike was also a reaction to growing public frustration with Turkey’s policy toward Syria — which has done little to push Mr. Assad out, while bringing hardship to Turks, who have lost trade and have been forced to take in about 100,000 refugees — and to the Turkish leadership’s sense of having been left alone by Western allies to manage an increasingly combustible situation, experts and commentators said.

“I don’t see what else the government could do,” said Soli Ozel, an academic and a columnist, who said he viewed Turkey’s response as one of restraint that made good on warnings that it would strike Syria if its border was threatened. “That is the least they could do. They have so tied themselves to massive retaliation rhetoric that they had to do something.”