WASHINGTON — President Obama decided in recent weeks to authorize a more expansive mission for the military in Afghanistan in 2015 than originally planned, a move that ensures American troops will have a direct role in fighting in the war-ravaged country for at least another year.

Mr. Obama’s order allows American forces to carry out missions against the Taliban and other militant groups threatening American troops or the Afghan government, a broader mission than the president described to the public earlier this year, according to several administration, military and congressional officials with knowledge of the decision. The new authorization also allows American jets, bombers and drones to support Afghan troops on combat missions.

In an announcement in the White House Rose Garden in May, Mr. Obama said that the American military would have no combat role in Afghanistan next year, and that the missions for the 9,800 troops remaining in the country would be limited to training Afghan forces and to hunting the “remnants of Al Qaeda.”

The decision to change that mission was the result of a lengthy and heated debate that laid bare the tension inside the Obama administration between two often-competing imperatives: the promise Mr. Obama made to end the war in Afghanistan, versus the demands of the Pentagon that American troops be able to successfully fulfill their remaining missions in the country.