HOUSTON >> C.J. Stroud threw for 331 yards and a touchdown and Ka’imi Fairbairn’s tiebreaking 59-yard field goal as time expired lifted the Houston Texans to a 23-20 win over the Buffalo Bills on Sunday.

The Texans (4-1) led 20-3 after a field goal early in third quarter before the Bills scored 17 straight points to tie it with about 3½ minutes to go. Stroud was called for intentional grounding to bring up fourth-and-15 and take the Texans out of field-goal range with less than a minute left.

A punt backed the Bills up to their 3 and they punted after three straight incomplete passes to give Houston one last chance.

Dare Ogunbowale had a 5-yard run to set up Fairbairn’s game winner.

Already without running back Joe Mixon for a fourth straight game, Houston struggled offensively after losing NFL receiving leader Nico Collins to a hamstring injury after he scored a long touchdown early in the second quarter.

Stefon Diggs led the Texans with six receptions for 82 yards in his first game against his former team since a blockbuster offseason trade.

Josh Allen was 9 of 30 for 131 yards and a touchdown as the Bills (3-2) lost for a second straight week after opening the season with three straight wins. Allen struggled before halftime again Sunday, managing just 56 yards passing a week after throwing for 42 yards in the first half of a rout by the Ravens.

Dawuane Smoot’s strip-sack of Stroud gave the Bills the ball at the Houston 15 with 4½ minutes to play.

They had the first play of the ensuing drive with Mitchell Trubisky at QB while Allen was in the medical tent being checked out after banging his head hard on the turf a few plays earlier. He re-entered the game on second down but threw two incompletions.