Pitt (6-7) led 31-6 when ACC offensive player of the year James Conner had his second touchdown run with 14 minutes left in the game.
Houston (8-5) went on to the biggest comeback in an FBS game this season, and the third-largest ever in a bowl game.
Ward had an 8-yard TD pass to Deontay Greenberry before the Cougars recovered their first onside kick. That led to a 29-yard catch by Demarcus Ayers on a fourth-and-13 play with 1:58 left, and Houston tried another onside kick.
Just landed and read about the Coogs great comeback. Congrats to all the young men and especially the seniors for going out a winner.— Tom Herman (@CoachTomHerman) January 2, 2015
Congratulations Cougars...amazing victory over Pittsburgh. Go Coogs!!— Renu Khator (@UHpres) January 2, 2015
While the second one didn't go 10 yards on the rain-slickened field, the ball was touched by the same Pitt defender who couldn't handle the first one before Houston running back Kenneth Farrow jumped on it at the Cougars 43. Greenberry started the drive with a 38-yard catch, then on third-and-16 had a 25-yard TD with 59 seconds left.
Interim coach David Gibbs opted for a win-or-lose 2-point conversion try, and Greenberry made a leaping catch in the back corner of the end zone.
Farrow ran 22 times for 103 yards and two touchdowns for the Cougars, who have split their four appearances in the 12-year history of the Armed Forces Bowl.
Ward finished 15-of-24 passing for 274 yards, with 237 of those yards and all three TDs coming in the fourth quarter. Greenberry had eight catches for 85 yards, also all in the fourth quarter.
Conner's 1-yard TD run a minute into the second quarter capped a 15-play, 92-yard drive, starting the scoring and putting Pitt ahead until the final minute of the game. The Cougars had a missed extra point after Farrow's 2-yard TD in the second quarter when Kyle Bullard slipped while kicking.
Gibbs, the defensive coordinator, was filling in for fired Houston coach Tony Levine. The Cougars' new coach is Ohio State offensive coordinator Tom Herman, who still has one more game with the Buckeyes after they upset top-ranked Alabama in the Sugar Bowl to advance to the national championship game Jan. 12.
New Pitt coach Pat Narduzzi was at the game, a day after his finale as Michigan State's defensive coordinator in the Spartans' comeback 42-41 win over Baylor in the Cotton Bowl. That game was played inside the Dallas Cowboys' NFL stadium about 20 miles away Thursday.
Paul Chryst, a Madison native and former Wisconsin offensive coordinator, left Pitt last month after three seasons to become head coach of the Badgers.
The young Panthers have an FBS-high 81 underclassmen, with Conner, All-ACC receiver Tyler Boyd and quarterback Chad Voytik among 28 sophomores.
Voytik threw was 18-of-35 passing for 222 yards and an impressive 16-yard TD catch by tight end J.P. Holtz between two defenders in the front corner of the end zone. But Voytik had six consecutive incompletions on a final desperate drive when only a pass interference penalty got Pitt a first down.
Boyd had nine catches for 112 yards, his 11th career 100-yard receiving game and moving from seventh to fourth on Pitt's career reception mark with 163, two more than Larry Fitzgerald.