WASHINGTON—U.S. Special Operations Forces have begun venturing out with Pakistani forces on aid projects, deepening the American role in the effort to defeat Islamist militants in Pakistani territory that has been off limits to U.S. ground troops.

The expansion of U.S. cooperation is significant given Pakistan's deep aversion to allowing foreign military forces on its territory. The Special Operations teams join the aid missions only when commanders determine there is relatively little security risk, a senior U.S. military...