Mr. Mattis’s shift will move the military away from Obama-era rules that allow American forces to strike the Taliban if they are shooting at or otherwise threatening American or Afghan forces. Instead, under the changes, American aircraft could seek out and attack militants based simply on their affiliation to the group.

“You see some of the results of releasing our military from, for example, a proximity requirement — how close was the enemy to the Afghan or the U.S.-advised Special Forces,” Mr. Mattis said on Tuesday in front of the Senate Armed Services Committee. “That is no longer the case, for example. So these kind of restrictions that did not allow us to employ the air power fully have been removed, yes.”

He made similar remarks testifying that afternoon in front of the House Armed Services Committee.

The changes are similar to the rules of engagement governing the fight against the Islamic State in Syria and Iraq as well as in eastern Afghanistan, where the extremist group has been active for the past two years.

They also hark back to the height of the war in Afghanistan, when about 100,000 American troops were fanned out across the country and intelligence was regularly harvested in an effort to produce more targets for fleets of American aircraft and hundreds of Special Operations forces.

David W. Barno, a retired Army lieutenant general, who led the war effort in Afghanistan for almost two years, said the changes probably indicate that the American military is shifting from a largely defensive war and “getting off its hands and much more involved in combat operations.”

Indeed, Mr. Mattis’s push to implement more aggressive rules of engagement coincides with his decision to place American troops closer to the fighting, which he stresses will be in only an advisory role. It is also the latest move in a string of military decisions by the Trump administration to give more decision-making authority to troops at lower levels.

Mr. Mattis’s comments also provided some clarity about a remark made last month by President Trump in front of the United Nations General Assembly. During a speech, Mr. Trump said that he had “totally changed” the rules of engagement against the Taliban and terrorist groups in Afghanistan as part of his new strategy for South Asia.