Direct proof of use
WIRED reported in May 2013 that M40 106 mm recoilless rifles had been put to use in Afghanistan by U.S. Special Forces units and were used extensively by Danish and Australian armies during ground operations there. The article tied the Afghanistan use to the weapon's direct-fire utility against mud-walled buildings and other targets where some guided anti-tank weapons were less suitable.
A separate YouTube video, indexed under the title "106mm Recoilless firing with a Special Forces Team in Naray, Afghanistan," describes a 106 mm recoilless rifle being fired during training at Firebase Naray in Kunar Province, Afghanistan, circa 2004, in preparation for an anticipated Taliban attack.
Sources: WIRED M40 Afghanistan Use, Naray 106mm Recoilless Video
Timeline
The dated public evidence begins with the circa-2004 Naray video description, which places a 106 mm recoilless rifle with a U.S. Special Forces team at Firebase Naray in Kunar Province. The video source documents training and preparation rather than a named combat engagement.
WIRED's 31 May 2013 report gives the broader use claim: U.S. Special Forces, Danish forces, and Australian forces had used M40-series 106 mm recoilless rifles in Afghanistan. The report does not give a full chronology, unit roster, or rifle count.
Sources: Naray 106mm Recoilless Video, WIRED M40 Afghanistan Use
Battlefield role
In Afghanistan, the M40 appears in the public record as a niche direct-fire support weapon rather than a general-issue infantry arm. WIRED described it as useful in ground operations where targets were inside mud-walled buildings, a common Afghan fighting environment in which blast effects could be reduced.
The available sources support use on the U.S.-led, NATO, and Afghan government side of the conflict. They do not support Taliban use, a settled count of rifles in theater, or a comprehensive list of engagements.
Sources: WIRED M40 Afghanistan Use, Naray 106mm Recoilless Video