AUSTIN, Texas (AP) — Sam Ehlinger passed for two touchdowns and ran for a score, all in the second half, and Texas ended a four-game losing streak to No. 17 TCU with a 31-16 victory Saturday in the Big 12 opener for both teams.

Texas (3-1) had been outscored 153-33 the last four years by TCU and trailed 16-10 before the defense forced three turnovers by quarterback Shawn Robinson in the third quarter.

A fumble recovery set up a diving touchdown catch by Collin Johnson and an interception return by freshman safety Caden Sterns to the TCU 2 set up Ehlinger’s scoring run one play later. Ehlinger’s 38-yard touchdown strike to Lil’Jordan Humphrey with 3:18 left put the game away.

The victory gives Texas its first three-game win streak since 2014. The Longhorns also have their first back-to-back wins over ranked opponents since winning three in a row in 2008, a run that vaulted Texas to No. 1 that season.

Ehlinger passed for 255 yards. Johnson finished with 124 yards on seven catches.

Texas mostly shut down a TCU running game that had gained at least 200 yards in each of its first three games. Texas allowed the Horned Frogs (2-2) 141 yards on the ground Saturday, but took it away for much of the first half. Robinson passed for 197 yards.

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)