Smoke rises after a bomb fired from Syria struck Akçakale in Turkey, killing five and prompting a complaint from Turkey to the UN. Photograph: Anadolu Agency/Reuters

Turkey's military have struck targets inside Syria in response to a mortar bomb fired from Syrian territory which killed five Turkish civilians, Prime Minister Recep Tayyip Erdogan's office said in a statement.

The mortar fired from the Syrian side into the region of Akçakale sparked an urgent round of meetings with military chiefs and led the Turkish foreign minister, Ahmet Davutoglu, to formally complain to UN secretary general Ban Ki-moon.

"Our armed forces in the border region responded immediately to this abominable attack in line with their rules of engagement; targets were struck through artillery fire against places in Syria identified by radar," the statement from Erdogan said. "Turkey will never leave unanswered such kinds of provocation by the Syrian regime against our national security."

Map of the bombing location

Nato said it was following developments and senior officials would meet urgently to discuss the issue. Turkey is a member state of the powerful body and earlier this year invoked a clause in the Nato treaty which called on it to respond to an earlier clash in which a Turkish jet was shot down from inside Syria.

The Aleppo bombings were among the biggest seen in Syria in 18 months of uprising. Attackers, believed to have been dressed in military fatigues, are thought to have convinced regime soldiers stationed in Saadallah al-Jabiri Square to let them enter the secure zone. They are then thought to have detonated the bombs believed to have been packed into cars.

Devastation was immense in the square. State television pictures also revealed significant damage to nearby residential buildings and offices. Both the Free Syria Army and a jihadist group, known as the Jabhat al-Nusra, claimed responsibility for the attack. Both said the blasts had targeted a military officer's club. Regime officials said the bombings were a suicide terrorist attack that had killed scores of civilians.

Saadallah al-Jabiri Square is not far from Aleppo's ancient market, parts of which have been destroyed in recent days during intense clashes between regime troops and rebels. The battle for Aleppo is taking an increasingly heavy toll on the city's historical sites as battle lines, which are drawn largely through a north to south line, slowly shift.

The regime's military remains in control of much of the west of the city, but its grip in parts has steadily been loosened throughout almost three months of relentless guerilla fighting.

Rebels are now mounting hit and run attacks in most parts of Aleppo, which until recent weeks has been a city of two halves. The regime military maintains dominance of the country's skies and has access to much heavier weapons than the rebel military, yet it remains unable to assert itself across a vast tract of land from Aleppo to the Turkish border and east to the desert regions that spread towards Iraq.

Aleppo has become a focal point of the now blazing civil war. Both sides acknowledge that the outcome of the war depends on the battle for the ancient city.

Daily death tolls in Syria now constantly exceed 120 and more than 30,000 people, many of them civilians, are believed to have been killed since the uprising began.

• This article was amended on 4 October 2012, because the original misspelled the name of the Turkish foreign minister as Ahmed Davagotlu. He is Ahmet Davutoglu.