By Angus McDowall and Tom Perry

BEIRUT (Reuters) - Syrian rebels on Wednesday vowed to fight on in east Aleppo in the face of sudden government advances that have cut the area held by the opposition by a third in recent days and brought insurgents in the city to the brink of a catastrophic defeat.

Gains by the Syrian army and its allies since last week have brought whole districts back under government control and led to a human exodus as thousands have fled their pulverized neighborhoods near the rapidly shifting front lines.

With the rebels now reduced to an area just kilometers across, the leaders of Russia and Turkey, two of the most powerful supporters of the opposing sides in the war spoke by phone on the need for a ceasefire, according to sources in Ankara.

The army and its allies said they had taken the Sheikh Saeed district in the south of the city on Wednesday. Rebels denied this, saying the government's advance had been repelled. The Syrian Observatory for Human Rights, a British-based monitoring group, said the insurgents retained a third of Sheikh Saeed.

The Observatory reported that the government was detaining and questioning hundreds of those fleeing rebel-held areas for the comparative safety of state-controlled districts.

A Syrian military source denied this, saying there had been no arrests, but adding that displaced people whose identities were not known were being moved into "specific places" in the areas of Aleppo where fleeing civilians were found.

In their attack on Wednesday, government forces stepped up the use of air strikes, including in Aleppo's Old City, according to a rebel official. Rescue workers in eastern Aleppo said 45 people were killed in an artillery bombardment.

The U.N.'s aid chief, Stephen O'Brien, told a Security Council emergency meeting on Aleppo that dozens of humanitarian staff were trapped in Aleppo and that warring parties must protect civilians before the city becomes "one giant graveyard".

After a year of gradual advances for Syrian President Bashar al-Assad, backed by Russia, Iran and Shi'ite militias, the taking of Aleppo would represent a huge stride forwards in his efforts to end the rebellion after nearly six years of conflict.

For the mostly Sunni Muslim rebel groups, the fall of Aleppo would deprive them of their last big foothold in a major city. A leadership council of the rebel groups in Aleppo called on all men able to bear arms to "defend the oppressed".

Russia, Assad's most powerful international ally whose air force has pounded rebels for more than a year, said it hoped the Aleppo situation could be resolved by the end of the year. Rebels in the city have vowed no surrender.

NO WITHDRAWAL

While rebel lines collapsed unexpectedly in parts of eastern Aleppo at the weekend, sources on the government side say the next phase could be more difficult as they try to take more densely populated areas of the city.

Zakaria Malahifji, head of the political office of the Aleppo-based Fastaqim rebel group, told Reuters that rebel groups in the city had rejected any withdrawal.

"This is the decision of the factions. I spoke to them about everything that was tabled and they said they would not withdraw, and other things may also happen," he said from Turkey, without giving further details.

With tens of thousands of people remaining in rebel-held areas of Aleppo, many say they would rather risk death than surrender to a government they have been trying to overthrow since protests against Assad began in 2011.

Thousands of people who have fled the fighting have gone into the Kurdish-controlled Sheikh Maqsoud district rather than hand themselves over to a government which U.N. investigators have accused of secretly detaining activists and civilians.

Salem Abu Mudar, an east Aleppo resident reached by Reuters, said that although he had never taken up arms against the government, "I fear the regime will not let me go and I will end up in one of its many prisons".

Damascus says such reports of arbitrary detention and torture are fabricated.

The Syrian military source said reports of detentions in Aleppo were intended to scare the people into staying under rebel rule, and that identities of people leaving the area had to be checked to ensure they were not militants.

The army has urged Aleppo's rebel factions to accept a surrender under which they would abandon the city. In previous deals between the government and rebels, insurgents have been given safe passage to the opposition-held province of Idlib.

RENEWED ASSAULT

Rescue workers in the rebel zone said renewed artillery bombardment had killed more than 45 people, mostly women and children, on Wednesday and injured dozens more, including some of those who had fled from frontline areas. The Observatory put the toll from that attack at 26.

"Today there was another massacre, I witnessed it. The displaced people were coming at 6:30 am. There was artillery shelling while they were walking in the streets. Really, it was so, so horrible," said Aref al-Aref, a nurse and photographer in a rebel-held part of the city.

Footage sent by the Civil Defence rescue operation, purportedly of the aftermath, showed people lying in the street in pools of blood, including a woman dressed in black who had been carrying a large backpack. Reuters could not independently verify the date or location of the video.

Rebel shelling of government-held districts in western Aleppo killed eight people, including two children, and wounded seven, the official SANA news agency reported, citing a source in the city's police force.

With diplomatic efforts to resolve the war in deadlock, and uncertainty over the position that the next U.S. administration will take on Syria, Moscow said it had been in contact with President-elect Donald Trump's team on the matter.

Russian soldiers helped distribute food aid to displaced people who had fled eastern Aleppo to government areas, handing out packages stamped with the Russian flag and the slogan "Russia is with you" in Arabic.

Russian President Vladimir Putin and Turkish President Tayyip Erdogan agreed in a telephone conversation on Wednesday on the need for a ceasefire and provision of aid to Aleppo, sources in Erdogan's office said. Moscow did not immediately comment on the call.

But Russian U.N. Ambassador Vitaly Churkin told the Security Council: "We share the grave concerns of the plight of civilians in east Aleppo, but easing their suffering won't happen by ceasing the counter terrorist operation."

Russian Foreign Minister Sergei Lavrov is due to meet his Turkish counterpart in the Mediterranean city of Antalya on Thursday.

The fighting has displaced around 50,000 people in the parts of east Aleppo where fighting has occurred, the Observatory said on Wednesday.

Speaking in Paris, Brita Hagi Hasan, president of the local council in rebel-held Aleppo districts, said the government should set up a safe corridor for civilians to leave.

(Additional reporting by Ellen Francis and Dahlia Nehme in Beirut, Maria Kiselyova in Moscow, John Irish in Paris and Stephanie Nebehay in Geneva, Michelle Nichols in New York; Writing by Angus McDowall; Editing by Peter Graff and Giles Elgood)