Discuss as:

Obama: US not staying in Afghanistan longer than necessary

President Barack Obama says NATO will lay out benchmarks for a "peaceful transition" and that "challenges in that environment" are an indication that "now is the time for us to transition."

President Barack Obama said Tuesday that the United States and its partners were on track to turn over responsibilities to their Afghan counterparts and withdraw from Afghanistan by 2014, in spite of recent riots sparked by the burning of several Qurans by U.S. soldiers at the Bagram airbase.

Obama said the riots were "tragic," and the violence directed at U.S. troops is "unacceptable."

"I think it is an indication of the challenges in that environment and it's an indication that now is the time for us to transition," the president said at a news conference.

Report: 5 soldiers involved in Quran burning

Despite an apology from Obama, the incident at Bagram airbase, which is being used by both U.S. and foreign forces under the NATO banner, ignited a wave of anti-Western fury across the country. Muslims consider the Quran the literal word of God and treat each book with deep reverence.

At least 30 people were killed in the protests.

Afghan clerics demand trial of Quran burners at US base

The Quran burnings hurt U.S. efforts to win more trust from Afghans, an essential part of efforts to weaken the Taliban and force the militant group to negotiate an end to the war, now in its 11th year.

Obama said Tuesday the U.S. needs to ensure a "gradual" transition of power in Afghanistan, adding that President Hamid Karzai is eager for more responsibility.

The U.S. is not interested in staying in Afghanistan any longer than necessary, Obama said.

"It's not going to be a smooth path, there are going to be bumps along the road just as there were in Iraq," he concluded.

More from msnbc.com and NBC News:

Follow us on Twitter: @msnbc_world