In a stunning move on Sunday, Riley, 38, accepted the head-coaching position at USC.
"Leaving OU was probably the most difficult decision of my life," Riley said in a statement released by Oklahoma. "OU is one of the best college football programs in the country, and it has been forever. ... This was a personal decision solely based on my willingness to go take on a new challenge, and I felt like it was the right opportunity for me and my family to do that."
At USC, Riley replaces former Trojans coach Clay Helton, who was fired in September after posting a 46-24 record in seven seasons.
"Lincoln is the rarest combination of extraordinary person and elite football coach," USC athletic director Mike Bohn said in a statement announcing the hire. "His successes and offensive accolades as a head coach the past five years are astonishing. ... Lincoln is universally considered one of the brightest and most talented football coaches in the nation, and the fact that he chose USC is a testament to the strength of our brand, the power of the Trojan Family, and the leadership of our university."
Riley called the football tradition at USC "unparalleled."
"I look forward to honoring that successful tradition and building on it," he said in the statement released by USC. "The pieces are in place for us to build the program back to where it should be and the fans expect it to be."
Riley guided the Sooners to four consecutive Big 12 titles and three College Football Playoff appearances in his first four seasons. Oklahoma was eliminated from the Big 12 championship game following a 37-33 loss at Oklahoma State on Saturday night.
Following the Bedlam loss, after there was widespread speculation that he was LSU's choice to replace the departing Ed Orgeron, Riley said, "I'm not going to be the next head coach at LSU."
"I'd like to thank Coach Riley for all he has done to help our football program since he arrived in Norman in 2015," Oklahoma athletic director Joe Castiglione said in a statement Sunday. "When we met with the team today, I communicated to our players that our program is about them. It will always be bigger than any one person. And just as it's always been, Oklahoma football is positioned for greatness."
Former Oklahoma coach Bob Stoops, who will be inducted into the College Football Hall of Fame on Dec. 7, will take on the interim title and coach the Sooners' bowl game.
Stoops coached the Sooners for 18 seasons before retiring in June 2017. He led Oklahoma to a national championship in 2000, 10 Big 12 championships and 14 seasons of double-digit victories, and held a 190-48 overall record before handing off the program to Riley ahead of the 2017 season. He has remained active around the program, including helping to coach a practice last year when the staff was short-handed because of COVID-19 cases.
"First and foremost, I'm a program guy and whatever I can do to help OU and to support the players, of course I'm glad to do it," Stoops said in a statement. "I'll do everything I can to help them finish the season in a strong and successful way and I look forward to that."
Donte Williams, who has served as the Trojans' interim coach since Helton's firing, will finish out the season in that role.
Also heading to USC is Alex Grinch, who is set to go with Riley as his defensive coordinator, sources told ESPN's Chris Low. Grinch, a four-time nominee for the Broyles Award as the top assistant in college football, has been the Sooners' defensive coordinator and safeties coach for the past three seasons. He previously served stints at Ohio State and Washington State.
Riley's departure is a big blow to the Sooners, who are about to transition into the SEC. Riley had a 55-10 record in five seasons, including a 37-7 mark in the Big 12.
Oklahoma has targeted Arizona Cardinals coach Kliff Kingsbury as one of the potential replacements for Riley, league sources told ESPN's Adam Schefter.
Kingsbury has one year remaining on his contract after this season.