Washington State coach Mike Leach is the new head coach at Mississippi State, Bulldogs athletic director John Cohen said Thursday.

"Mike Leach is a proven winner who has established a culture of excellence for nearly two decades as a head coach," Cohen said in a statement. "An offensive genius and two-time national coach of the year, he has a track record of building programs to national prominence with accountability and a blue-collar approach. We are thrilled to welcome him and his family to the Mississippi State family and look forward to watching our football program grow under his leadership."

Leach is receiving a four-year contract that will pay him $5 million annually. Mississippi state law limits the contract length to four years.

He can also earn a number of bonuses, including $50,000 for SEC Coach of the Year (coaches or AP), $100,000 for National Coach of the Year, $100,000 for an SEC title game appearance and $250,000 for winning SEC title game.

For the postseason, he would earn up to $150,000 for an appearance in a non-New Year's Six bowl, $200,000 for a New Year's Six bowl, $400,000 for making the CFP and $500,000 for making the national title game.

Leach would get $1 million for winning the national title.

He is also getting a $4.7 million compensation pool to pay 10 assistant coaches.

The deal is done. See you back in StarkVegas at Bryan Field at 3:15 PM with @Coach_Leach! #HailState pic.twitter.com/qMM06Hz29A — John Cohen (@JohnCohenAD) January 9, 2020

Washington State coaches were informed about Leach's move on Thursday morning, a source told ESPN.

"I can't tell you how excited I am to be the head football coach of the Mississippi State Bulldogs," Leach said in a statement. "I loved Washington State, but I am excited for the next chapter in the SEC. It's a privilege to be a part of the MSU family, and we look forward to getting down to Starkville shortly."

Leach had agreed in principle to a one-year contract extension through the 2024 season on Dec. 5 before the Cougars' appearance in the Cheez-It Bowl.

Before accepting the job at Mississippi State, Leach talked to Arkansas about its opening, sources told ESPN's Chris Low, and was close to landing the Tennessee job two years ago before John Currie was fired as the Volunteers' athletic director.

Leach will succeed Joe Moorhead, who was fired Jan. 3 after going 14-12 in two seasons with the Bulldogs. His stint ended with a 38-28 loss to Louisville in the Franklin American Mortgage Music City Bowl.

Overall, in 18 seasons, Leach has taken his teams to 16 bowls, and his "Air Raid" passing attack has led FBS 10 times.

His style is anything but typical. Leach gets a lot of attention for his news conferences, where he has been known to dole out wedding advice, once pondered which Pac-12 mascots would survive a fight and told tales about his passion for pirates. He taught a class at Washington State last year called Insurgent Warfare and Football Strategies.

He went 55-47 in his eight seasons in Pullman and took the Cougars to a school-record five consecutive bowl games over the past five seasons. After a school-record 11-win season and a No. 10 national ranking in 2018, the Cougars went 6-7 in 2019, capped by a 31-21 loss to Air Force in the Cheez-It Bowl.

Before Leach's arrival, Wazzu did not appear in a bowl game for eight straight seasons and had won just nine games in four years under previous coach Paul Wulff.

"On behalf of Washington State, we would like to thank Coach Leach for his eight years of service to the Cougars," Washington State University president Kirk Schulz and athletic director Pat Chun said in a statement. "Mike has transformed Washington State Football into a national brand and we will be forever grateful. We wish he and Sharon nothing but the best in their next chapter at Mississippi State. Now we look forward to elevating the Cougs to the highest levels of college football."

play 1:04 The wisdom of Mike Leach Mike Leach is one of football's most unpredictable, entertaining personalities. Here's what happens when you give him a mic.

Leach's 43 wins since 2015 marks the most for a Washington State coach during a five-year span. The Cougars have led the FBS in passing offense four times in the past seven seasons. In 10 seasons as the head coach at Texas Tech (2000-09), Leach guided the Red Raiders to a 84-43 record.

Among those to welcome Leach to his new job on social media was Lane Kiffin, the new coach for rival Ole Miss.

Mississippi State visits Ole Miss in the Egg Bowl on Nov. 26. The annual game is traditionally played on Thanksgiving night.

Leach's new job also comes with an immediate, if not unusual, home-field advantage.

Earlier this season, Leach, as part of college football's 150th anniversary celebration, was asked what was the worst visitors locker room that he's ever been in. Without hesitation, he answered: "Mississippi State."

He described a locker room in which the walls, floor and ceiling were all concrete, and "there was no furniture, there was no benches, there was no lockers." In addition to 37 nails in the wall, Leach said there were two toilets, side by side and without seats, in the middle of the locker room. Between them: one roll of toilet paper.

"My heart swelled with pride," Leach said. "... The ultimate touch of brilliance."

It has not all been fun and games, though.

Leach was fired by Texas Tech after being accused of mistreating a player, Adam Jones -- the son of former ESPN announcer and NFL player Craig James -- who had suffered a concussion. He then clashed with his bosses, and sued Texas Tech for wrongful termination. The school was protected by state law, but Leach is still trying to fight that case. He also filed a lawsuit against ESPN and Craig James that was later dismissed.

When his teams have struggled, his news conferences have been far less amusing. Leach has not been shy about calling players soft and making other disparaging remarks.

The Associated Press contributed to this report.