KABUL, Afghanistan (AP) — Afghan forces have repelled a Taliban attack on the Kandahar airport that lasted more than 24 hours and killed 50 people, mainly civilians, the Defense Ministry said Thursday.

It said the dead included 38 civilians, 10 Afghan soldiers and two police. It said the 11 "terrorists" who took part in the assault were killed, and that the fighting ended late Wednesday.

Afghan forces have struggled to roll back Taliban advances since the U.S. and NATO formally concluded their combat mission at the end of last year.

The sprawling airport, known as Kandahar Air Field, has a military and a civilian section, as well as a NATO base. There were no coalition casualties.

Also on Thursday, the head of Afghanistan's main intelligence service resigned, citing differences with President Ashraf Ghani, who assumed office a little over a year ago.

Gen. Rahmatullah Nabil said he did not agree with the president's policies in recent months, without providing further details. The four-star general had served as head of the National Directorate of Security for five years.

Ghani said in a statement that he accepted Nabil's resignation and would replace him with someone from within NDS.