The Obama administration is looking at ways to stop the advancement of the Islamic State, the Sunni militant group taking over large swaths of land in Iraq and Syria, but it may be forced to turn its focus to the increasingly deadly Taliban offensive in Afghanistan. The president may choose to leave a higher number of soldiers in Afghanistan after 2014 than he has previously said, to avoid a situation like Iraq's, where ISIS -- now called Islamic State after capturing vast parts of the country -- has been able to advance without a credible opponent.   

For more than three weeks, the Taliban has increasingly attacked Afghan security officials in an attempt to take back strongholds it occupied before U.S.-led forces entered the country in 2001. The uptick in Taliban assaults comes just four months before the U.S. is supposed to begin withdrawing its troops from the country.

The attacks are part of the massive campaign launched by the Taliban in May, after the U.S. announced it would begin withdrawing its troops by the end of the year. According to local media reports, the campaign spans across the entire country, from Kunduz to Kabul to Helmand province. At the same time that the Taliban is infiltrating and trying to take over key cities, Afghanistan is still waiting for the official results of its presidential election in April. The votes are currently being recounted and the official tally will most likely not be revealed until Sept. 10.

Earlier this month, at least 700 Taliban fighters attacked police forces in Logar province, around 50 miles (80 km) from Kabul, in an attempt to capture towns that would give it access to roads leading to the capital.

Since then, Taliban fighters have attacked several other towns across the country, not only near Kabul but also in the south and north. The Washington Post reported this week that the Taliban entered the Sarwan Qala village in Lashkar Gah, the capital of Helmand province, forcing residents to flee.

According to a report by the International Crisis Group published earlier this year,t the number of Islamist insurgent attacks in the country had increased by 15 to 20 percent in 2013 from the year before. The increasingly violent Taliban attacks pose a threat to the Afghan security forces that have relied on U.S.-led NATO forces for help for years.

U.S. troops in the country, which are now mostly working as advisors to local troops, are scheduled to begin leaving Afghanistan by Dec. 31, but that could change in the next few months. President Obama announced in May that he would leave 9,800 soldiers in Afghanistan after the end of combat operations in December, and would pull them all out by 2016. But the president has come under fire for a similar decision in Iraq; with ISIS advancing in both Iraq and Syria, some blame him for pulling out of Iraq too soon, which could affect how the U.S. handles its troop withdrawal in Afghanistan in the upcoming months.

Obama vowed when he took office that he would end the wars in Iraq and Afghanistan. But his actions in Iraq could indicate that he may be reconsidering the decision to leave Iraq. He has sent hundreds of military advisors back into the country to assist the Iraqi and Kurdish militaries, and to coordinate airstrikes.

It is unclear how the administration will respond to the increasingly violent clashes in Afghanistan, but it is possible that Obama will choose to keep more than 9,800 troops in the country beyond December.

According to a report published by Amnesty International this month, in recent years the “vast majority of civilian deaths in Afghanistan have been the result of attacks by the Taliban and other parties in conflict.” According to the United Nations Assistance Mission in Afghanistan, “insurgents were responsible for more than three-quarters of civilian deaths in 2013 while international forces were responsible for just 5 percent of them.”