HOUSTON >> All week, Stefon Diggs downplayed how big it would be when he faced the Buffalo Bills for the first time since a blockbuster trade brought him to Houston.

On Sunday, after the Texans used a last-second field goal to eke out a 23-20 victory, the star receiver finally admitted how important this game was to him.

“I’m not going to sit here and act like it was just regular,” he said. “It meant a lot to me and it was reassuring that the guys around me knew that it meant a lot to me, even if I didn’t say it. I just try to just keep it poised and treat every week like it’s the same … but I’d be lying if I said it didn’t mean a lot.”

C.J. Stroud threw for 331 yards and a touchdown and Ka’imi Fairbairn’s tiebreaking 59-yard field goal as time expired lifted Houston to the victory.

Diggs led the Texans with six receptions for 82 yards and said that Sunday was an emotional day for him after spending the past four seasons in Buffalo.

“I was just trying to take advantage and get a win for my team, but obviously, it’s emotional,” he said.

The Texans (4-1) led 20-3 early in the third quarter before the Bills scored 17 straight points

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.

“It wasn’t all pretty,” Texans coach DeMeco Ryans said. “But it’s the way you finish at the end and I’m proud of the way our guys finished.”

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.

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.

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

After Allen threw incompletions on second and third down, the Bills tied it on a 33-yard field goal.

The Bills had cut the lead to 10 when James Cook scored on a 5-yard run with about nine minutes left in the third.

Rookie Keon Coleman’s 49-yard reception on fourth-and-5 got the Bills within 20-17 on their next drive. Coleman slipped a tackle and then darted down the sideline before flipping into the end zone for his second TD this season.

The Texans took a 7-3 lead when Cam Akers ran 15 yards for a score with about three minutes left in the first quarter.

Collins got in front of the defense for a 67-yard TD reception on the first play of Houston’s next drive to make it 14-3.

Fairbairn, the former UCLA All-American, added a 50-yard field goal as time expired in the second quarter and his 47-yarder early in the third made it 20-3.