SDEROT, Israel — Israel confronted fire along two of its borders on Sunday, with rockets landing from Gaza and a mortar shell crashing in from Syria, prompting Israel to respond with what its military described as “warning shots” at a Syrian position across the frontier for the first time in 39 years.

From the early hours of Sunday morning through nightfall, more than 50 rockets fired by Palestinian militants from Gaza struck southern Israel. The first heavy barrage came as residents of this rocket-battered town near the Gaza border were getting up to go to work and school.

Around noon, to the north, a stray Syrian mortar shell hit an Israeli military post on the Israeli-held Golan Heights as Syrian government forces battled armed rebels on the other side of the Israeli-Syrian armistice line that has been in place for decades. It was the fourth time in just over a week that spillover from the Syrian civil war had crept toward Israel.

After years of relative quiet along the country’s borders, Prime Minister Benjamin Netanyahu finds himself tested on two fronts. Under increasing pressure and with Israelis scheduled to go the polls in January, the nation’s leaders are talking tough and threatening broader action.