COLLEGE STATION (AP) —Dennis Franchione gave Texas A&M another victory over Texas. Then the embattled coach handed in his resignation.

While there were no Big 12 titles or bowl victories in Franchione’s five seasons, his tenure ended on a high note, a 38-30 victory over 13th-ranked Texas that gave the Aggies consecutive wins over their hated rival.

“This team has been special all year to me,” Franchione said. “And I thought they played a wonderful game.”

Then, Franchione announced he was resigning. He accepted a buyout from the school.

“I’ve always said that coaches exist for only one reason —the players,” he said. “We want them to know that we love them, feel blessed for our time together, and will miss them.”

The victory over Texas was too late to save Franchione, coming after four losses the previous five games and his secret e-mailed newsletter for big-money boosters.

Still, Franchione left with A&M’s first consecutive victories over the Longhorns since 1991-94 under his predecessor, R.C. Slocum.

“Been with him five years and fought hard, and it’s a hell of a way to go out,” center Cody Wallace said. “Go out with a win.”

Stephen McGee threw for a career-high 362 yards with three touchdowns and scored on a hard-driving run. Holder T.J. Sanders got his only career TD when he capped A&M’s 95-yard drive with a 5-yard TD run on a fake field goal and the defense forced three turnovers (two fumbles, interception) by Texas quarterback Colt McCoy.

Mike Goodson ran 12 times for 72 yards and caught six passes for 82 yards and two touchdowns for the Aggies (7-5, 4-4 Big 12). McGee was 25-of-36 with two interceptions.

Texas (9-3, 5-3), which after its first 0-2 conference start since 1956 had won five straight games, still has an outside shot of making it to the Big 12 championship game if 10th-ranked Oklahoma loses to Oklahoma State on Saturday.

“It’s really hard,” Texas defensive back Brandon Foster said. “You never enjoy losing, but losing to the Aggies is just even worse.”

McCoy was 17-of-32 for 229 yards. Jamaal Charles ran 17 times for 92 yards, with an 8-yard TD the play after Foster’s 38-yard interception return in the third quarter.

Two touchdowns in the final 7:36 weren’t enough for the Longhorns, who now must wait and see what happens Saturday.