WASHINGTON — President Barack Obama signed a secret order in recent weeks authorizing a more expansive mission for the military in Afghanistan in 2015 than originally planned, the New York Times reported Friday, citing unnamed U.S. officials.

The newspaper said the move ensures that U.S. troops will have a direct role in fighting in the war-ravaged country for at least another year.

Obama's order allows U.S. 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 this year, according to several administration, military and congressional officials with knowledge of the decision. The new authorization also allows U.S. jets, bombers and drones to support Afghan troops on combat missions.

In an announcement in the White House Rose Garden in May, Obama said that the U.S. 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-Qaida."

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 Obama made to end the war in Afghanistan, versus the demands of the Pentagon that U.S. troops be able to successfully fulfill their remaining missions in the country.

The internal discussion took place against the backdrop of this year's collapse of Iraqi security forces in the face of the advance of the militant Islamic State of Iraq and Syria.

Obama's decision, made during a White House meeting in recent weeks with his senior national security advisers, came over the objection of some of his top civilian aides, who argued that American lives should not be put at risk next year in any operations against the Taliban — and that they should have only a narrow counterterrorism mission against al-Qaida, according to the officials, who spoke on condition of anonymity.

But the military pushed back, and generals both at the Pentagon and Afghanistan urged Obama to define the mission more broadly to allow U.S. troops to attack the Taliban, the Haqqani network and other militants if intelligence revealed that the extremists were threatening American forces in the country, these officials said.