"Our armed forces at the border region responded to this atrocious attack with artillery fire on points in Syria that were detected with radar, in line with the rules of engagement," the Turkish government said in a statement from the prime minister's office.
The artillery fire capped a day that began with four bombs tearing through a government-held district in Syria's commercial and cultural capital of Aleppo, killing more than 30 people and reducing buildings to rubble.
Along the volatile border, a shell fired from inside Syria landed on a home in the Turkish village of Akcakale, killing a woman, her three daughters and another woman, and wounding at least 10 others, according to Turkish media.
The shelling appeared to come from forces loyal to Syrian President Bashar Assad's regime, which is fighting rebels backed by Turkey in an escalating civil war.
"Turkey, acting within the rules of engagement and international laws, will never leave unreciprocated such provocations by the Syrian regime against our national security," the office of Prime Minister Recep Tayyip Erdogan said in a statement.
Turkish media said Turkey has prepared a parliamentary bill for Syria that is similar to one that authorizes the Turkish military to intervene in northern Iraq in pursuit of Kurdish militants who have bases there. The bill is expected to be discussed in parliament on Thursday, Anadolu agency reported.
If approved, the bill could more easily open the way to unilateral action by Turkey's armed forces inside Syria, without the involvement of its Western and Arab allies.
Secretary of State Hillary Rodham Clinton said the U.S. was "outraged that the Syrians have been shooting across the border," adding that she would speak with Turkish Foreign Minister Ahmet Davutoglu on the matter.
"It's a very, very dangerous situation," Clinton said. "And all responsible nations need to band together to persuade the Assad regime to have a cease-fire, quit assaulting their own people and begin the process of a political transition."
NATO's National Atlantic Council, which is composed of the alliance's ambassadors, held an emergency meeting in Brussels Wednesday night at Turkey's request to discuss the cross-border incident.
The meeting ended with a statement strongly condemning the attack and saying: "The alliance continues to stand by Turkey and demands the immediate cessation of such aggressive acts against an ally." It also urged the Syrian regime to "put an end to flagrant violations of international law."
NATO also held an emergency meeting when a Turkish jet was shot down by Syria in June, killing two pilots.
Turkey wants to avoid going into Syria on its own. It has been pushing for international intervention in the form of a safe zone, which would likely entail foreign security forces on the ground and a partial no-fly zone. However, the allies fear military intervention in Syria could ignite a wider conflict, and few observers expect robust action from the United States, which Turkey views as vital to any operation in Syria, ahead of the presidential election in November.
According to Turkey's NTV station, the Syrian information ministry said it had launched an investigation into Wednesday's shelling and expressed sorrow for the deaths of Turkish civilians. But it urged Turkey to prevent the cross-border infiltration of what it called terrorists.
Turkey, which has moved military reinforcements to the border in recent months, has more than 90,000 Syrian refugees in camps along its border, and also hosts Syrian opposition groups.
There is concern in Turkey that the Syrian chaos could have a destabilizing effect on Turkey's own communities; some observers have attributed a sharp rise in violence by Kurdish rebels in Turkey to militant efforts to take advantage of the regional uncertainty.
Calling Wednesday's shelling "yet another example of the depraved behavior of the Syrian regime and why it must go," Pentagon press secretary George Little said the U.S. would continue to monitor the situation closely.
One senior U.S. official said that while the exchange of fire between Syria and Turkey is problematic, it will not necessarily trigger a NATO response under Article 5, which states that an attack against one NATO member shall be considered an attack against all members.
The official said that NATO action is unlikely given the scale of the shellings so far between the two nations. But the official said that could change if the violence begins to greatly escalate. The official spoke on condition of anonymity because he was not authorized to comment publicly on the sensitive deliberations.
Turkey's Anadolu news agency quoted the governor of Sanliurfa province, Celattin Guven, as saying three or four shells fell on the border village and one hit a house, killing the women and children. The wounded included two police officers who were shown in television footage lying in the street as colleagues tended to them.
There was no immediate claim of responsibility for the Aleppo bombings earlier in the day, but the government blamed its opponents, saying the huge explosions were caused by suicide attackers. The technique is a signature of al-Qaida-style jihadist groups, some of which are known to have entered Syria's civil war to fight against the regime.
"It was like a series of earthquakes," a shaken resident told The Associated Press, asking that his name not be used out of fear for his personal safety. "It was terrifying, terrifying."
The Syrian government said the bombings killed 34 people and injured 122 - although death tolls have been difficult to verify. The Britain-based Syrian Observatory for Human Rights, which relies on a network of activists on the ground, said at least 40 people were killed.
The state-run Ikhbariya TV channel showed massive damage around Saadallah al-Jabri Square, which also houses a famous hotel and a coffee shop that had been popular with regime forces. One building appeared to have been leveled and the facade of another was torn away.
The station broadcast video of several bodies, including one being pulled from a collapsed building. Rescuers stood atop piles of concrete and debris, frantically trying to pull out survivors.
Activists could not reach the area, which is controlled by security forces and sealed off with checkpoints.
The uprising against Assad began in March 2011 and gradually became a bloody civil war. The conflict has killed more than 30,000 people, activists say, and has devastated entire neighborhoods in Syria's main cities, including Aleppo.
Syria's government has always blamed the uprising on what it calls foreign terrorists, despite months of peaceful protests that turned violent after repeated attacks by security forces. The transformation of the conflict into an open war has given an opportunity to foreign fighters and extremists, analysts say.
The Syrian opposition denies any links to terrorists, but a Sunni extremist group called Jabhat al-Nusra, or Victory Front, has claimed responsibility for bombings in the past.
After Wednesday's blasts in Aleppo, regime forces unleashed shelling on rebel-held areas and fired machine guns from aircraft, according to an Associated Press journalist in the city, Syria's largest with a population of 3 million.
At least 15 people wounded by shelling arrived with serious injuries at the city's Shifa Hospital. All but one were civilians. Three bodies - an old man, a woman and a middle school-age boy - also were taken to the hospital.
Rebel fighters, many with only light weapons, advanced slowly, moving building by building. The heavier weapons, such as rocket-propelled-grenade launchers, were sent to the front lines to prevent the regime from retaking areas seized by rebels in the past two months.
Wednesday's attacks were the latest turn in the deadly - and increasingly chaotic - fight for control of Aleppo, one of the world's oldest continuously inhabited cities.
Long free of the violence that has engulfed much of the rest of the country in the first year of the uprising, Aleppo was struck by two suicide car bombings at security compounds in February, killing 28 people. Such attacks targeting security agencies and soldiers have become common in Syria, particularly in the capital of Damascus.
In the past two months, Aleppo has become a key battleground. The opposition launched an offensive on the city in July, and large swaths have been shattered.
Rebels last week announced a new push to capture Aleppo, which would be a major strategic prize and give the victor new momentum. It also would provide the opposition with a base and easy logistical supply lines with Turkey to the north that would allow them to carry out their fight against the regime in the rest of the country.
Aleppo-based activist Mohammad Saeed said Wednesday's blasts went off minutes apart and appeared to be car bombs and were followed by clashes and heavy gunfire.
Syrian state TV said three suicide bombers detonated cars packed with explosives in Saadallah al-Jabri Square, near an officers' club. The square holds symbolic importance for residents because it is named after a Syrian independence fighter who resisted French occupation.
Activists and Syrian state media said a fourth car bomb went off a few hundred meters (yards) away in the Bab Jnein area near the Old City. It was not immediately clear how many casualties there were from that blast.
The Syrian Observatory for Human Rights said mortars also targeted the nearby political security department around the same time of the bombings.
Syria's Interior Ministry vowed to "track down the perpetrators anywhere." The speaker of the Syrian parliament, Mohammad Jihad al-Lahham, told the assembly that he condemns "the countries that conspire against Syria and stand behind the terrorists."
Torchia reported from Istanbul. Associated Press writers Suzan Fraser in Ankara, Turkey; Zeina Karam in Beirut; Manu Brabo in Aleppo, Syria; Albert Aji in Damascus, Syria; Don Melvin in Brussels; and Lolita Baldor and Bradley Klapper in Washington contributed to this report.