"This atrocious attack was immediately responded to adequately by our armed forces in the border region, in accordance with rules of engagement,” said a written statement from the office of the prime minister, carried by the semiofficial Anatolian News Agency. “Targets were shelled in locations identified by radar.”

“Turkey, in accordance with the rules of engagement and international law, will never leave such provocations by the Syrian regime against our national security unrequited,” the statement added.

NATO said it would convene an urgent meeting on the issue Wednesday. Before firing into Syria, Turkey contacted the United Nations and NATO to protest the killings and express its “deepest concern.” Secretary of State Hillary Rodham Clinton said she was “outraged” by the mortar attack in Turkey.

The five Turkish civilians — a woman, her three children and a relative — were killed in the town of Akcakale, and their deaths were the first caused by the stray shells that have frequently flown across the border, a Turkish official said. Angry residents of the town marched to the mayor’s office demanding security measures, Turkish NTV reported.

It was unknown whether the mortar fire came from Syrian government forces or rebels fighting to topple the government of President Bashar al-Assad. The Turkish response seemed to assume that the Syrian government was responsible.

Atilla Sandikli, the director of the Ankara-based Center for Strategic Studies, said on NTV that Syria was trying to pull Turkey into the conflict, and that the government should react with “utmost care.”

The incident ratcheted up tensions that have grown with Turkey’s support of the Syrian insurgency and the Syrian government’s downing of a Turkish plane over the Mediterranean in June. “This last incident is pretty much the final straw,” the Anatolian News Agency quoted Bulent Arinc, the deputy prime minister, as saying.

In Aleppo, Syria, on Wednesday, several huge explosions struck a government-held district, shearing off the fronts of two tall buildings, killing dozens of people and filling the streets with rubble in a square near a public park, according to video, photographs and reports from the Syrian government and its opponents.

At least two explosions, which both sides said appeared to be car bombs, struck Saadallah al-Jabiri Square near an officers’ club and two government-owned hotels that residents said had housed pro-government militiamen who had essentially taken over the square. Another explosion struck near the chamber of commerce in nearby Bab Jenine, both sides reported.

There was no immediate claim of responsibility for the suicide bombings, which came after several days of increased violence in Aleppo, Syria’s largest city, that has caused anguish for government supporters and opponents alike. Since Friday, a spike in fighting has brought a new level of destruction and chaos to Aleppo’s downtown and its treasured medieval old city. The scale of Wednesday’s bombings seemed to deepen the city’s sense of alarm and disgust, bringing expressions of horror and bewilderment from people on either side of the conflict.

“Oh, my God, the destruction is huge,” an accountant who works nearby, who asked to be identified only by his first name, Rami, said on his cellphone as he tried without success to approach the square, which he said was barricaded by security forces. Back in his office, listening to gunfire still echoing through the area, he wrote on Facebook: “My soul has died and my body is waiting for its turn.”

One Syrian activist, who uses the pseudonym Anonymous Syria, wrote on Twitter: “Whoever is behind those explosions is a terrorist if civilians were killed. Whether it is the regime, Al-Nusra brigade” — a Qaeda-affiliated insurgent group — “or the Free Syrian Army.”

In the square, men simply shouted obscenities and cursed “the terrorists’ fathers.” Their voices could be heard in the background as another man videotaped the bomb scene for a pro-government YouTube channel, panning over the corpses of two men in crisp camouflage uniforms who he said were would-be suicide bombers killed by security forces.