Petty and the Bears shook off a sluggish start to produce three touchdowns over the final 7:02 of the first half. That led to one of the most significant wins in school history and kept alive Baylor's hopes for an unlikely shot at the national championship.
Baylor is 8-0 for the season and 5-0 in the Big 12, tied for the conference lead with unranked Texas. The Longhorns will try to move a half game in front of Baylor when they travel to West Virginia on Saturday.
The Bears have games remaining against Texas Tech, Oklahoma State, TCU and Texas to end the regular season on Dec. 7.
Oklahoma failed to capitalize on early field position and owned only a 5-3 lead in what was an unexpected defensive duel through a quarter and a half.
Baylor then got its high-powered offense in gear and roared to a 24-5 halftime lead.
Petty put the Bears in front to stay with a 5-yard scoring run, then drove them the length of the field for another touchdown that he delivered from a yard out.
On the first play after that touchdown, Oklahoma's Blake Bell threw one of his two interceptions and Petty soon found Antwan Goodley for a 24-yard scoring throw that came with 13 seconds left in the half.
Petty added touchdown tosses of 17 yards to Levi Norwood in the third period and of 25 yards to Goodley in the fourth.
Although he did not score, Baylor's Shock Linwood dominated on the ground with 194 yards on 24 carries. Petty completed 13-of-27 passes for 203 yards without an interception.
Oklahoma fell to 7-2, its other loss having come against Texas, and the Sooners are 4-2 in league play.