The San Diego Padres hired Bob Melvin to a three-year contract as their new manager on Thursday, bringing on one of the most respected figures in baseball after the Oakland Athletics granted him permission to interview for the job, sources told ESPN.

Melvin, who turned 60 on Thursday, won three American League West titles in his 11 years as Oakland manager after previous stops as manager for the Seattle Mariners and Arizona Diamondbacks. His career record, in 18 years managing, is 1,346-1,272.

The Padres fired manager Jayce Tingler after stumbling to a 79-83 finish in 2021. After entering the season with hopes of competing with the Los Angeles Dodgers in the National League West, the Padres collapsed in the second half and let go of Tingler after two seasons.

Melvin inherits a talented team led by star shortstop Fernando Tatis Jr. and third baseman Manny Machado. The Padres return the majority of their core, which includes infielder Jake Cronenworth, center fielder Trent Grisham, second baseman Adam Frazier and a strong starting rotation of Yu Darvish, Blake Snell and Joe Musgrove. Their deep bullpen is the sort of strength Melvin could exploit, having done so with a perpetually overachieving A’s team.

His tenure in Oakland was a wild success following tenures in Seattle and Arizona that ended with disappointment. With the A’s, Melvin developed a reputation as a players’ manager as well as a keen strategist, and in a division in which his team often carried the lowest payroll, he found consistent success.

Melvin was not among the known candidates for the San Diego job, which included former New York Mets manager Luis Rojas and former Chicago White Sox manager Ozzie Guillen. Despite exercising an option for Melvin in 2022, Oakland allowed him to interview with San Diego, and he’ll leave without any compensation returning to the A’s, ESPN’s Alden Gonzalez reports.

The Padres, perpetually aggressive under general manager A.J. Preller, already hired pitching coach Ruben Niebla from Cleveland this offseason to serve on their staff. The acquisition of Melvin dovetails with their hopes of a quick recovery from a troublesome 2021 season, in which performance issues and clubhouse troubles torpedoed their hopes of winning the franchise’s first World Series.

San Diego’s ascent started with the signing of Machado and the star turn from Tatis, the 22-year-old who earlier this year signed a 14-year, $340 million contract. Among their left side of the infield, talented young position players and a pitching staff bolstered by trades for Darvish, Snell and Musgrove, the Padres looked to build on their playoff appearance in the COVID-shortened 2020 season with a breakout in 2021.

Instead, a strong start to the season devolved into subpar performances and internal issues as the Padres tried to weather injuries to Tatis’ left shoulder, which he subluxed multiple times. Tatis nevertheless put up MVP-type numbers, though a lack of pitching depth doomed the Padres.

Already Preller has rejiggered his scouting and player development departments, and the stability Melvin brings with a multiyear deal matches well with the Padres’ window of contention.

Oakland, in the meantime, is preparing for a transitional winter. Opponents believe first baseman Matt Olson will be available via trade, and the A’s constant churn in search of contention could hit a roadblock after an 86-win season in which they finished behind Houston and Seattle in the AL West.

The news of Melvin’s agreement with the Padres was first reported by MLB.com.