* Helicopters strafe Aleppo
* Government declares victory in battle for Damascus
* Battle for Aleppo seen as potential turning point
By Erika Solomon
ALEPPO, Syria, July 30 (Reuters) - Syrian troops said they had recaptured a district of Syria's largest city Aleppo, after heavy fighting against rebels who remain in control of swathes of the commercial hub despite being pushed out of the capital Damascus.
The past two weeks have seen forces of President Bashar al-Assad struggle as never before to maintain their grip on the country after a major rebel advance into the two main cities and a July 18 explosion that killed four top security officials.
Government forces have succeeded in imposing their grip on Damascus but rebel fighters gained control of parts of Aleppo, a city of 2.5 million people, where Reuters journalists have toured neighbourhoods dotted with Free Syrian Army checkpoints flying black and white Islamist banners.
U.S. Defense Secretary Leon Panetta said attacks on Aleppo were putting the nail in the coffin of Assad's government, showing he lacks the legitimacy to rule.
"If they continue this kind of tragic attack on their own people in Aleppo, I think it ultimately will be a nail in Assad's own coffin," Panetta said, speaking to reporters at the start of a weeklong trip to the Middle East and North Africa.
"What Assad has been doing to his own people and what he continues to do to his own people makes clear that his regime is coming to an end. It's lost all legitimacy," he said, adding, "It's no longer a question of whether he's coming to an end, it's when."
Fighting for the past several days has focused on the Salaheddine district in the southwest of Aleppo, where government troops have been backed by helicopter gunships.
Rebel fighters, patrolling opposition districts in flat-bed trucks flying green-white-and-black "independence" flags, said they were holding off Assad's forces in Salaheddine. However, the government said it had pushed them out.
"Complete control of Salaheddine has been (won back) from those mercenary gunmen," an unidentified military officer told Syrian state television late on Sunday. "In a few days safety and security will return to the city of Aleppo."
Reuters journalists in the city were not able to approach the district after nightfall on Sunday to verify whether rebels had been pushed out. The pro-opposition Syrian Observatory for Human rights said fighting was continuing there.
The government also declared victory on Sunday in the battle for the capital, which the rebels assaulted in force two weeks ago but have been repulsed in unprecedented fighting.
"Today I tell you, Syria is stronger ... In less than a week they were defeated (in Damascus) and the battle failed," Foreign Minister Walid Moualem said on a visit to Iran, Assad's main ally in the region.
"So they moved on to Aleppo and I assure you, their plots will fail."
Rebel-held areas of Aleppo visited by Reuters were almost empty. Fighters were basing themselves in houses.
Cars entering one Aleppo district came under fire from snipers and a Reuters photographer saw three bodies lying in the street. Unable to move them to hospital for fear of shelling, residents had placed frozen water bottles on two of the corpses to slow their decomposition in the baking heat.
A burnt out tank lay in the street, while nearby another one had been captured intact and covered in tarpaulin. Burnt cars could be seen in many streets, some marked with "shabbiha" - a reference to pro-Assad militiamen.
Near the centre of town, most shops were shuttered, some with "Strike" painted over them. The only shop doing business was a bakery selling subsidised bread, where the queue stretched around the block.
U.N. Undersecretary-General for Humanitarian Affairs Valerie Amos said 200,000 people had fled the fighting in and around Aleppo in the last two days, and the violence across Syria made it hard for humanitarian agencies to reach them.
"Many people have sought temporary shelter in schools and other public buildings in safer areas. They urgently need food, mattresses and blankets, hygiene supplies and drinking water."
Assad's ruling structure draws strongly on his Alawite minority sect, an offshoot of Shi'ite Islam, while his opposition is drawn largely from the Sunni Muslim majority, backed by Sunni leaders who rule nearly all other Arab states.
That has raised fears the 16-month conflict could spread across the Middle East, where a sectarian divide between Sunnis and Shi'ites has been at the root of violence in Iraq, Lebanon, Bahrain and elsewhere.
Shi'ite Iran demonstrated its firm support for Assad by hosting his foreign minister. At a joint news conference with Moualem, Iran's Foreign Minister Ali Akbar Salehi rebuked the West and Arab states for holding the "illusion" that Assad could be easily be replaced in a managed transition.
In Damascus, many residents have fled fighting in the outskirts for relative safety in the heart of the capital.
In the centre, shops open only between 9 a.m. and 3 p.m., food prices have soared and no one dares walk outside after dusk, even in the holy month of Ramadan when streets are normally packed late into the night with people breaking the fast.
"To begin with I was with the regime, for sure," said Ahmed, from one of the southern suburbs where the army, backed by helicopters and tanks, launched its counter-offensive.
"But now, no, the regime must go. Take what they want with them, but they must go."
The battle for Aleppo is a decisive test of the government's ability to put down the revolt after the July 18 explosion killed four of its top security officials and wrecked the Assad family's image of untouchable might.
It has committed huge military resources to Aleppo after losing control of outlying rural areas and some border crossings with Turkey and Iraq.