WASHINGTON — The C.I.A. is expanding its covert operations in Afghanistan, sending small teams of highly experienced officers and contractors alongside Afghan forces to hunt and kill Taliban militants across the country, according to two senior American officials, the latest sign of the agency’s increasingly integral role in President Trump’s counterterrorism strategy.

The assignment marks a shift for the C.I.A. in the country, where it had primarily been focused on defeating Al Qaeda and helping the Afghan intelligence service. The C.I.A. has traditionally been resistant to an open-ended campaign against the Taliban, the primary militant group in Afghanistan, believing it was a waste of the agency’s time and money and would put officers at greater risk as they embark more frequently on missions.

Former agency officials assert that the military, with its vast resources and manpower, is better suited to conducting large-scale counterinsurgencies. The C.I.A.’s paramilitary division, which is taking on the assignment, numbers only in the hundreds and is deployed all over the world. In Afghanistan, the fight against the Islamic State has also diverted C.I.A. assets.

The expansion reflects the C.I.A.’s assertive role under its new director, Mike Pompeo, to combat insurgents around the world. The agency is already poised to broaden its program of covert drone strikes into Afghanistan; it had largely been centered on the tribal regions of Pakistan, with occasional strikes in Syria and Yemen.