HOUSTON — Brock Osweiler and the Houston Texans offense were booed while they struggled for much of Sunday night’s game against the Indianapolis Colts.

But Osweiler got it together in the fourth quarter, throwing two touchdown passes to tie it before leading a drive in overtime that ended in a field goal and gave the Texans a 26-23 victory .

“Nothing was pretty about tonight … and none of those guys quit fighting,” Osweiler said.

In overtime, he threw a 36-yard pass to Jaelen Strong to get Houston to the 12, and Nick Novak’s 33-yard field goal came two plays later.

“Brock never changes one bit,” Strong said. “It wasn’t just a fourth-quarter thing. He’s the same thing 24-7. He believes in us and we believe in him.”

Indianapolis (2-4) got the ball first in overtime, but Benardrick McKinney sacked Andrew Luck on third down to force a punt.

Osweiler’s two touchdown passes came in less than 2 minutes in the fourth quarter as Houston (4-2) erased a 14-point deficit to tie it at 23 with 54 seconds left. He found Lamar Miller on a 10-yard catch-and-run TD with 2:47 remaining and, after a stop by the defense, connected with C.J. Fiedorowicz on a 26-yarder that tied it.

“Through all the negativity and the boos … I’m so proud of this team because everyone stayed focused on their job,” Osweiler said. “They ignored the outside noise. They ignored the boos.”

Osweiler was criticized this week after he played poorly in a lopsided loss to Minnesota last Sunday. His mistakes and indecisiveness in that game had some wondering if he was worth the $72 million contract Houston gave him in the offseason.

Coach Bill O’Brien insisted all week that they remained confident in Osweiler’s ability to lead this team and that he and everyone around the quarterback simply had to do a better job. Osweiler had negative-9 yards passing in the first quarter, and an interception late in the third quarter led to a touchdown that left Houston down 20-9.

O’Brien was asked what changed for Osweiler after that.

“We called plays that he likes and he executed them with his teammates,” O’Brien said.

Osweiler finished with a season-high 269 yards passing, two touchdowns and one interception to give him eight touchdown passes and eight interceptions this season.

Texans owner Bob McNair voiced his support for Osweiler, but noted that he’d like to see him play like he did late throughout a game.

“I think he showed what he can do,” McNair said. “We need to do it for four quarters and not wait until the end, but it shows you that he has the ability and the mindset and the determination and confidence to lead the team back from a very deep hole that we were in.”

AP NFL website: www.pro32.ap.org and www.twitter.com/AP_NFL