Opposing Force opens with Shephard riding on a V-22 Osprey with his squad. His squad discuss their deployment, somewhat irritated that they have not been told what they are being deployed for. However, as they are nearing their Landing Zone at Black Mesa, airborne alien creatures attack the Osprey formation, causing Shephard's Osprey to crash land. Shephard regains consciousness in a Black Mesa medical bay, tended to by the science team, learning that the Marines are being steadily beaten by the alien forces from Xen and orders have come through to pull out. Consequently, Shephard departs to reach an extraction point and escape the facility. However, Shephard is prevented from reaching the extraction point by the enigmatic G-Man, forcing the evacuation craft to leave without him.
Other Marines who have also been left behind team up with Shephard and attempt to reach another extraction point near Black Mesa's Lambda Complex, but en route they come under attack from black operations units seeking to thoroughly contain the situation and eliminate all survivors. Shephard makes it to the Lambda Complex alive, and briefly sees Gordon Freeman as the latter teleports to Xen in the final stages of Half-Life. To escape the teleportation chamber, Shephard is forced to enter a separate portal, briefly taking him to Xen before depositing him in an entirely different area of the facility. The facility is now heavily damaged, and it soon becomes clear that a new alien race, Race X, has exploited the situation to mount a localized invasion, attacking both human and Xen forces in Black Mesa indiscriminately. Fighting between the black operations units and Race X quickly intensifies.
Shephard soon encounters more stranded Marine units in the wreckage of the base, and tries to break through the black operations units to reach an escape point past the facility's storage unit, but meets heavy resistance from both Race X and the black operations units. A surviving Black Mesa security guard reveals to Shephard that the black operators intend to detonate a tactical nuclear weapon in the base, thereby totally sealing it off and killing everything in it. After successfully neutralizing the guarding black operations unit, Shephard disarms the device and proceeds to the nearby storage areas, intent on escape. However, the G-Man rearms the device as Shephard departs. The storage unit has become a thick battleground between Race X and the black operation units, and although Shephard manages to evade them, he is informed by another security guard that something very large is coming through an alien portal blocking the exit path.
At the portal, Shephard discovers a gene worm, a massive creature facilitating the Race X invasion. Shephard is able to kill the creature, but just afterwards he is teleported onto an Osprey by the G-Man. As the G-Man congratulates Shephard on his accomplishments, the nuclear device detonates in the background, destroying Black Mesa. The game closes with the G-Man detaining Shephard someplace where he can tell no one of what he has seen and cannot be harmed, pending further evaluation.