The airport battle was the second major Taliban attack in Kandahar in the past 24 hours. The day before, the Taliban engaged with officers at a police station, above. Allauddin Khan / AP

The bodies of some of the Taliban fighters killed during the attack lie at the scene. Jawed Tanveer / AFP / Getty Images

The attack took place as a major conference on regional security was beginning in neighboring Pakistan. Jawed Tanveer / AFP / Getty Images

The entrance gate of the airport. The Taliban fighters who staged the attack used AK-47 assault rifles and wore military uniforms. Reuters

Afghan National Army soldiers at the site of a clash with Taliban fighters at Kandahar Airport, Dec. 9, 2015 that claimed the lives of 37 people. Jawed Tanveer / AFP / Getty Images

At least 37 people have been killed and 35 wounded in a Taliban assault on the Kandahar airport compound, Afghan defense officials have said — as a major conference on security in the region got underway in neighboring Pakistan.

The Taliban, which claimed responsibility for the attacks, targeted residential compound and military bases at the airport, which is used by Afghan, U.S. and NATO military forces. The siege was declared to be over Wednesday afternoon local time but the attack could overshadow the high-level talks in Pakistan aimed at reviving peace talks, while underlying the continued threat from armed groups.

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

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.

It is likely to lead to questions 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.

The latest 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."

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 Mohammed Rasool Akhund, sparking speculation over the unity of the group.

Mullah Abdul Manan Niazi, the faction's spokesperson, 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.

Al Jazeera