AP photo by Justin Rex / Tennessee Titans quarterback Ryan Tannehill looks for a receiver during the first half of Sunday's game against the Houston Texans. Tannehill threw four touchdown passes, three of them in the second quarter, to lead the Titans to a 28-25 win in Houston.

HOUSTON — After a great first half, the Tennessee Titans were clinging to a three-point lead in the fourth quarter Sunday, having allowed the Houston Texans to score 18 in a row.

With the AFC's top seed on the line, veteran quarterback Ryan Tannehill knew he had to do something to rally his team.

"I told the guys: 'We need to make a play. We need our best right now,'" Tannehill said.

Then he orchestrated an eight-play, 85-yard drive capped by his fourth touchdown pass of the day, and Tennessee held on to win 28-25, clinching the top AFC spot and a first-round bye in the playoffs that start next weekend.

"We needed our best football," said Tannehill, who tied his NFL career high for touchdown passes in a game. "I needed to be great in that critical moment, and we were able to make those plays."

The Titans (12-5), who had already clinched their second straight AFC South Division title a week earlier, have the AFC's No. 1 seed for the third time since leaving Houston as the Oilers after the 1996 season and for the first time since 2008.

"These things don't happen too often," Tennessee safety Kevin Byard said. "We've got guys in the locker room who have never been a 1 seed and been in the league 10-plus years. We've definitely got to relish in this moment and understand that this is big time."

Tannehill threw three touchdown passes in the second quarter to put the Titans up 21-0 at halftime, but the Texans (4-13) came alive in the second half to get within a field goal of tying before Julio Jones caught his first touchdown pass of the season on a 3-yard grab that made it 28-18 with seven minutes remaining.

Tannehill's big day — 23-of-32 passing for 287 yards — came after he threw a career-high four interceptions in a 22-13 loss the first time Tennessee played Houston this season on Nov. 21 in Nashville.

"He came up with some huge plays," Titans coach Mike Vrabel said. "I thought he was in command most of the day executing the stuff."

The Texans capped an eight-play, 82-yard drive with a 7-yard touchdown catch by Danny Amendola early in the fourth quarter, and Davis Mills connected with Amendola again on the 2-point conversion to cut the lead to 21-18.

Houston cut the lead to three again when Amendola's second touchdown catch of the game made it 28-25 with four minutes to go, but Tennessee picked up a first down on third-and-2 with three minutes left, then ran out the clock to secure the victory.

David Culley, who wrapped up his first season as coach of the Texans, was encouraged by how his team finished after a slow start.

"This football team has always played hard," Culley said. "We haven't always played smart, but we've played hard. Today I think we played hard and we played smart."

Houston cut the lead to 21-7 when Mills found Chris Moore on a 28-yard pass on a flea-flicker with about 10 minutes left in the third, and the Texans got a 31-yard field goal from Kaimi Fairbairn late in the quarter to make it 21-10.

The Titans had scored the game's first points when Tannehill threw a 5-yard pass to Anthony Firkser midway through the second quarter. A.J. Brown made it 14-0 when he grabbed a 14-yard pass from Tannehill about 90 seconds before halftime.

The Titans then forced a punt, and Lonnie Johnson intercepted Tannehill in the end zone on a long pass on the next series. However, Eric Murray was called for pass interference to negate the pick and move the Titans 45 yards to the Houston 4.

Tannehill's third touchdown pass came on the next play when he connected with Nick Westbrook-Ikhine for a 4-yard score just before intermission. It was the first time a Titan has thrown three touchdown passes in a quarter since Steve McNair did it in 2005 against the San Francisco 49ers.

Vrabel raved about the play of Tannehill to keep the team on track after losing star running back Derrick Henry to a broken foot halfway through the regular season. Henry returned to practice this past week but was not activated for the regular-season finale.

"His toughness continues to show up," Vrabel said of Tannehill. "That's what you have to have in this league to play quarterback."

The Titans can rest as others play on wild-card weekend, and when they enter the postseason fray in the divisional round in two weeks, they'll do so at their Nissan Stadium with home-field advantage locked up throughout the AFC playoffs.

"We understand we're in the elite eight," Vrabel said. "We've moved on to the second round of the playoffs without having to play a playoff game."