The Syrian Democratic Forces (SDF), an alliance of Kurdish and Arab forces backed by the United States, have announced the capture of Raqqa after a four-month operation to drive out ISIL.

SDF spokesmen announced the takeover of the strategic Syrian city on Tuesday after a final battle at a sports stadium where Islamic State of Iraq and the Levant (ISIL, also known as ISIS) fighters made their last stand.

Al Jazeera's Hashem Ahelbarra, reporting from Antakya, Turkey, said clean-up operations were now under way after the bloody battle.

"Hundreds of SDF fighters, waving yellow flags, are now entering the city of Raqqa. They have killed dozens of fighters. They are deploying more troops in the city to try to clear mines, explosives," Ahelbarra said.

The SDF launched its offensive on Raqqa on June 6. Intense aerial bombardment and land operations by the US-led international coalition had cut the city off from the rest of the territories held by ISIL.

{articleGUID}

More than 3,000 bombs have landed on Raqqa since January, devastating schools, hospitals and residential buildings. In mid-October, the humanitarian REACH initiative estimated that less than one percent of Raqqa's 300,000 prewar population remained in the city. The city has no electricity or potable water, and its last functioning bakery was destroyed recently.

According to the Syrian Network for Human Rights, since the start of the operation, more than 900 civilians have been killed in the violence, including at least 570 in coalition air raids.

Destroyed and depopulated, Raqqa also faces an uncertain political future. The US and SDF have pledged to hand over the city to civilian rule, but the shape and political make-up of this civilian entity remain unclear. Various ethnic, tribal and geopolitical factors will complicate the handover.

Two competing councils

Two councils are asserting the right to take over the city: the Raqqa Civilian Council (RCC), founded in April and backed by the SDF; and the Raqqa Provincial Council (RPC), backed by the main Syrian opposition body based in Turkey, the Syrian National Coalition (SNC).

The RPC claims to be a successor to the civilian council that began administering Raqqa in 2013 after the Free Syrian Army and Islamist armed groups took the city from the Syrian regime. It rejects the RCC's legitimacy over its links to the People's Protection Units (YPG), a Kurdish armed group at the core of the SDF. Along with its political arm, the Democratic Union Party (PYD), it dominates most of northeastern Syria and is a close US ally.

As the YPG and Arab allies pushed into Raqqa province, the Syrian opposition accused it of carrying out ethnic cleansing against Arabs - an accusation YPG officials have denied.

Like other SDF-sponsored councils, the RCC has joint Arab-Kurdish leadership. The Arab co-chair is tribal leader Mahmoud al-Borsan, and the Kurdish co-chair is Layla Mohammed, the former co-mayor of her hometown of Tal Abyad on the Syria-Turkey border.

Al-Borsan heads the Walda tribe, which was forced to move to Hassakah province from the area near the city of Tabqa in Raqqa province after their lands were flooded during the construction of the Euphrates dam.

According to Abdel Aziz al-Hinnedi, a Syrian activist from Raqqa who fled to Germany after ISIL took the city in 2014, the RCC is not representative of the people of Raqqa, but its main strength is that it functions on the ground and provides services, as opposed to the rival RPC, which is in exile in Turkey.

{articleGUID}

In late September, the US made an effort to reconcile the two councils and create a joint one. Council members and Syrian civil society activists were invited to Rome to meet European Union government representatives. According to Noah Bonsey, a senior researcher at the International Crisis Group, EU countries have been reluctant to engage with the RCC, since they have worked with the SNC in the past few years.

The reconciliation attempt failed, however, when the Turkey-based RPC refused to attend the meeting. The RPC's dependence on Turkey, combined with the RCC's affiliation with the YPG - which Turkey deems a "terrorist" organisation - make a merger between the two impossible, Bonsey said.

The handover of Raqqa to the RCC could be rocky if the YPG maintains significant influence over the council.

"In YPG-held areas, a lot of times the local officials with major roles on paper; in practice, don't actually have a lot of influence, and we've seen aspects of governance basically managed by cadres within the YPG and the PYD. That has been a source of tension in some areas," Bonsey said.

Where does the Syrian regime fit in?

Another contender for post-ISIL legitimacy in Raqqa is Qamishli-born Ahmad Jarba, a former president of the SNC and a member of the Shammar tribe of eastern Syria. In 2016, backed by Saudi Arabia, he founded the Tomorrow Movement and its military arm, the Syrian Elite Forces. In February, Jarba announced that his 3,000-strong US-trained armed group would participate in the Raqqa battle, but according to al-Hinnedi, the SDF was not comfortable with its presence, and the group withdrew.

Jarba has been trying to recruit young men from Raqqa's tribes to join his Tomorrow Movement and the Elite Forces. Although he does not currently enjoy much popularity in Raqqa, he may have a role to play in administering Raqqa, al-Hinnedi said.

Yet another potential player on the political scene in post-ISIL Raqqa is the Syrian regime. The SDF has not sought to openly fight regime forces, although more recently there have been deadly confrontations.

According to Bonsey, while it is unlikely that the regime would have a military presence in Raqqa after its capture, it may pay for some services or state employee salaries, as it has done in other areas under YPG/PYD control. The RCC has already agreed to use regime-printed textbooks in schools in the areas under its control.

The tribes

The province of Raqqa has been traditionally inhabited by a number of Arab tribes, which various sides in the Syrian war have tried to coopt. In 2011, as protests spread across the country, President Bashar al-Assad sought the reassurance of tribal leaders in Raqqa that the province would stay quiet, and he received it.

Three years later, one of ISIL's Syrian leaders, Abu Loqman, is said to have used his connections as a member of the Ajeel tribe to facilitate ISIL's takeover of Raqqa.

Members of different tribes have also fought under the SDF's flag, including Daham Hadi Jarba, head of the Sanadid Forces, leader of the Shammar tribe and cousin of Ahmad Jarba. According to al-Hinnedi, however, tribes are not necessarily unified and can easily change loyalties.

"You would not find a tribal leader who carries the national interest and that of the Syrian people," he said. "They seek power and money and personal protection."

Will Raqqa be part of Rojava?

It is unclear whether Raqqa, with its SDF-backed council, would become part of the Kurdish autonomous project of Rojava, which has worried Turkey. Ankara has been embroiled in a bloody conflict with the Kurdistan Workers' Party (PKK), in which more than 1,700 people were killed between 2015 and 2016. The PKK considers the YPG its sister organisation.

In March, Saleh Muslim, the former PYD co-chair, told Reuters it was "likely" that Raqqa would join Rojava.

Responding to a question on the subject, Mustafa Bali, the SDF's head of media relations, told Al Jazeera in July, "Raqqa is part of Syria and Rojava is also part of Syria … The councils formed in those [liberated] regions will decide what form their administration will take."

According to Bonsey, the YPG has thus far not incorporated into Rojava certain Arab-majority areas it has taken from ISIL, such as Manbij.

Policing and rebuilding Raqqa

To help secure Raqqa, the US has been training the Raqqa Internal Security Forces (RISF). A statement by the international coalition's Operation Inherent Resolve, sent to Al Jazeera in July, said that the RISF consisted of 500 coalition-trained and vetted officers, and their number was expected to grow to 3,500.

In June, Reuters reported that a Kurdish man had been appointed as head of the RISF. The force has already started policing liberated areas around and inside the city of Raqqa, Bonsey said.

In the coming weeks, these forces, along with the SDF, will face the challenging task of demining Raqqa. ISIL is known for placing booby traps and mines not only in strategically significant positions during the fighting, but also in civilian housing and farm fields.

A much bigger challenge will be the reconstruction of Raqqa. According to al-Hinnedi, the city today is unlivable and will remain so for years. It remains unclear who will foot the bill for the massive destruction caused by the thousands of bombs the US-led coalition dropped on Raqqa.

While the coalition is spending about $13m daily to run Operation Inherent Resolve, it has not officially allocated funds for the reconstruction of areas it bombed in Syria.

In March, US Secretary of State Rex Tillerson told a meeting of the 68-nation coalition: "As a coalition, we are not in the business of nation-building or reconstruction."

In August, Brett McGurk, special presidential envoy for the Global Coalition to Defeat ISIS, said that the US would perform what he called "stabilisation" in Raqqa. Apart from demining, "stabilisation also means rubble removal so that trucks and equipment can get into areas of need. It means basic electricity, sewage, water, the basic essentials to allow populations to come back to their home," he explained.

Whether that will be enough for the close to 300,000 Raqqa residents to return to their city remains to be seen.

Follow Mariya Petkova on Twitter: @mkpetkova