A siege by Taliban fighters at the Kandahar airport compound in southern Afghanistan is over, Afghan officials say.

The Afghan ministry of defence says 37 people died and 35 were wounded in the assault that began on Tuesday night, just hours before a major conference on security got under way in neighbouring Pakistan.

The Taliban, which claimed responsibility for the attacks, targeted residential compound and military bases at the airport, which is used by Afghan, US and NATO military forces.

Officials told Al Jazeera the attackers used AK-47 assault rifles and wore military uniforms.They said all the fighters were killed and Afghan forces had retaken control of the area by Wednesday afternoon.

PROFILE: Mullah Akhtar Mansoor

Afghan special forces deployed to the scene had to move slowly to retake the airport as any fast movement could have caused civilian casualties due to a hostage situation, military officials said.

A man who was trapped in a building near the airport told Al Jazeera that residents were told to remain inside and take cover in case Afghan or US-NATO forces mistook them for fighters.

The incident was the second major Taliban attack in Kandahar within the past 24 hours.

Al Jazeera's Qais Azimy, in Kabul, said that there will be questions asked as to how the attackers were able to gain access to one of the most heavily fortified military compounds in the country.

On Monday night, Taliban forces stormed a Kandahar police station and engaged in a lengthy firefight in which three police officers and two of the attackers were killed, he said.

'Heart of Asia' 

The siege in Kandahar ended just hours after Afghan President Ashraf Ghani landed in Islamabad for the Heart of Asia regional conference that aims to revive peace talks with the Taliban.

"I strongly reiterate our commitment to lasting and just peace within which all movements that resort to arms convert themselves to political parties and participate in the political process legitimately," he said.

"Violence is not the way in a democratic society."

READ MORE: Afghans fear the rising influence of Taliban

Pakistan too has said it is committed to renewing the Afghan peace process.

"The emergence of newer and more threatening terrorist groups like Daesh should also strengthen our resolve against terrorism," Nawaz Sharif, Pakistan's prime minister, said at the conference on Wednesday, referring to the Islamic State of Iraq and the Levant (ISIL) group. 

"We should envisage collective and coordinated measures on the regional security front to ensure that the gains and struggle against terrorism are durable and irreversible."

The meeting, an annual gathering of Asian and other countries, comes months after the first, inconclusive talks between the Afghan government and the group.

Pakistani authorities hosted peace talks in early July. But the second round of talks were indefinitely postponed following news of the death of Mullah Omar, the group's leader.

In an audio message released last week, purportedly by Omar's successor, Mullah Akhtar Mansoor, Mansoor said the Taliban "won't agree to have peace talks if our demands are not met" - including the implementation of Islamic law in Afghanistan.

The message also dismissed reports of Mansoor sustaining injuries in a gun battle during a gathering of several Taliban figures in Pakistan, as "propaganda" aimed at dividing the group.

Last month, a breakaway faction of the Taliban elected its own leader, Mullah Mohammad Rasool Akhund, sparking speculation over the unity of the group.

READ MORE: Deadly Taliban infighting erupts in Afghanistan 

Mullah Abdul Manan Niazi, the faction's spokesman, expressed interest in peace talks last month.

Violent clashes between the two rival Taliban factions erupted in southern Afghanistan early last month leaving several dead from both sides and confirming the rift.


Source: Al Jazeera