The nightmare is over.

The Texans finished the historically terrible season with another loss Sunday, but they locked up the first overall draft pick for the third time in their history.

After driving 63 yards for a touchdown on the game’s opening series, the Texans were held to a field goal the rest of the way in losing 16-10 to the Tennessee Titans.

They became the sixth team in NFL history to lose 14 consecutive games in a season, but they became the first to do it after starting 2-0.

The 2005 Texans also finished 2-14, after which they drafted defensive end Mario Williams with the top pick. They also had the No. 1 selection in 2002, when they chose quarterback David Carr.

In what was likely his last game with the team, Matt Schaub completed eight of his first nine passes but then tapered off badly, throwing a third-quarter interception to set up the touchdown that gave the Titans a lead they wouldn’t surrender. The Texans turned the ball over four times, continuing a pattern that has plagued them throughout the disastrous season.

Schaub’s final pass of the day also was picked off.

They also failed to score a second-half touchdown for the ninth time this season. They’ve lost 10 times by the margin of a touchdown or less.