The Longhorns' announcement came about five hours after the school unexpectedly said it had fired Herman, who went 32-18 in four seasons at Texas and 7-3 this season, which culminated with a win over Colorado in the Valero Alamo Bowl on Tuesday.
Sarkisian, who won the Broyles Award as the top assistant in the FBS, said he "made a commitment" to Alabama coach Nick Saban and would remain with the No. 1 Crimson Tide through the College Football Playoff National Championship Presented by AT&T against No. 3 Ohio State on Jan. 11 (8 p.m. ET, ESPN/ESPN App).
Sarkisian said he'll juggle his duties preparing for the championship game, and trying to assemble a coaching staff at Texas and meeting with players individually. He said he has already had a team meeting and met with the current Longhorns staff.
"This is a unique and compelling opportunity to lead this storied program to the next level, competing once again amongst the best in college football," Sarkisian said about joining the Longhorns.
Sarkisian said he believes Texas has "championship talent" but acknowledged, "Clearly, there's work to be done or a change wouldn't be made."
"We all want Texas to be back. We all believe Texas should be back," Sarkisian said. "That's why I took, that's why I'm taking this job. But the reality of it is we have to put in the work. And then when you put in the work, then you get the outcomes that you desire."
Sarkisian, who is making $2.5 million per season on Saban's staff with the Crimson Tide, declined an interview with Auburn in its head-coaching search last month and turned down the Colorado head-coaching job last year.
He is the first assistant coach hired by Texas to lead its program since 1951, when the Longhorns promoted Ed Price to the role.
Texas didn't immediately release details of Sarkisian's deal. The Longhorns will owe Herman about $15 million to buy out the final three years of his contract. The Longhorns will owe about another $10 million to buy out the remaining contracts for his assistants, which are guaranteed multiyear deals.
"Hiring Steve Sarkisian represents a critical investment in our football program's future, not just for our student-athletes but for all of Longhorn Nation," university president Jay Hartzell said. "Our entire community benefits from a healthy and successful athletics program, and naming Steve as our coach infuses our football program with the necessary guidance and expertise to drive further success."
Sarkisian, 46, was USC's quarterbacks coach on Jan. 4, 2006, when Vince Young led the Longhorns to a 41-38 upset of No. 1 USC in the BCS National Championship at the Rose Bowl, ending the Trojans' 34-game winning streak. It was Texas' first national title since 1970.
"There has always been something special about Longhorn football, its history and traditions -- not just on that day -- and I could never have imagined that 15 years later, I would join the Longhorns as their head coach," Sarkisian said.
Sarkisian coached Heisman Trophy winners Carson Palmer and Matt Leinart at USC and star quarterbacks Tua Tagovailoa and Mac Jones at Alabama. He went 46-35 combined during head-coaching stints at USC and Washington.
At Texas, Sarkisian could have the chance to work with quarterback Sam Ehlinger, who hasn't decided whether to return for a fifth year or enter the draft.
ESPN's Mel Kiper Jr. ranks Ehlinger at No. 10 in his positional rankings for the upcoming draft.
"Clearly, Sam's a heck of a football player. I mean, this guy's a tremendous competitor," Sarkisian said. "He's somebody that I'd be remiss not to try to keep around. So definitely, there's a phone call, there's a phone call coming.
"But, you know, we'll see. He's got a personal decision to make. ... But I'll try to guide him as best I can with some of the information and knowledge that I have of what it looks like for him now and maybe what it would look like for him in a year."
Sarkisian's tenure at USC ended badly when then-athletic director Pat Haden fired him because of reported alcohol problems. At the time, ESPN reported that Haden had placed Sarkisian on a zero-tolerance policy regarding alcohol use. He entered rehab following his dismissal.
"I'm actually doing great," Sarkisian said. "Anytime you go through something like I went through and you make the personal decision to get the help that you know you need, it's a process to get that done. I've put in a lot of hard work and I'm proud of the work that I've put in. I know I'm a better man today than I was a little over five years ago, and that's not just as a football coach, but as a man, as a father and as a husband. All those things are very important to me."
Sarkisian worked as the offensive coordinator of the NFL's Atlanta Falcons in 2017 and 2018 before returning to Alabama in 2019.
Longhorns athletic director Chris Del Conte called Sarkisian "one of the top offensive minds in the game of football, which he has proved over and over during his time with USC, Atlanta and, most recently, Alabama."
"We are confident our players and coaches will thrive under his leadership and in response to his energy and passion for the game," Del Conte said.
This will be the sixth time Alabama has played for a national championship with a coordinator on his way out for a head-coaching position, going back to 2011, when offensive coordinator Jim McElwain accepted the Colorado State job.
Texas and Alabama are scheduled to play a home-and-home series in 2022 and 2023.
ESPN's Adam Rittenberg and Chris Low contributed to this report.