Yesterday’s killing of U.S. Army Major General Harold Greene in Afghanistan will not change the administration’s plans to leave a residual force in the country after U.S combat forces withdraw by the end of this year, according to the Pentagon.

Greene was the highest-ranking U.S. military officer to be killed in a combat zone since Vietnam. The incident—perpetrated by an Afghan security official, not an insurgent—is likely to spur calls for the U.S. to withdraw completely from Afghanistan.

The White House will have to weigh the calls for a complete withdrawal with competing pressure to keep U.S. forces in the country to prevent a situation similar to what we are now seeing in Iraq, where Islamist insurgents have taken over large swathes of the country.

Following President Obama’s recent announcement to leave a residual force presence of 9,800 troops in Afghanistan that would be fully withdrawn by the end of 2016, some members of Congress expressed concern the U.S. is drawing down too quickly, which would allow the Taliban to make territorial gains in Afghanistan the same way the Islamic State has done in Iraq and Syria.

Insider attacks in Afghanistan peaked in 2012 when Afghan security personnel turned their guns on at least 61 U.S. and NATO forces. Most of these attacks were committed by disgruntled security personnel, not Taliban infiltrators.

U.S. and Afghan officials have tightened vetting procedures and put in place other measures to mitigate the threat from insider attacks. These steps seemed to help, as insider attacks have become less common in the past two years.

The high-profile attack comes in the midst of a political crisis in the country in which claims of fraud in the June presidential runoff election have led to an internationally supervised ballot recount. Failure to resolve the electoral dispute could lead to ethnic divisions in the country and the prospect for ethnic-based violence the Taliban could exploit.

A prolonged election dispute and failure to establish a legitimate successor government also would jeopardize the United States’  ability to leave troops in Afghanistan post-2014, which requires the new Afghan government to sign a bilateral security agreement defining the terms of the U.S. deployment.

It is up to the Afghan leadership and the presidential contenders to demonstrate they are willing to take responsibility for securing their country’s democratic future. The U.S. can support the Afghans in fighting the insurgents, but it is up to the Afghans themselves to show their commitment to the democratic process.

Minor edits were made to this post for accuracy.