The San Diego Padres made two interesting moves ahead of the trade deadline on Monday.

The Padres acquired four-time All-Star Josh Hader from the Milwaukee Brewers for left-hander Taylor Rogers, righty Dinelson Lamet and prospects Robert Gasser and Esteury Ruiz, MLB.com reported.

Hader was one of the best closers in baseball in recent years, but a recent cold streak landed him in the middle of trade rumors. He leads the majors with 29 saves but has a 4.24 ERA. He was an All-Star this season and in 2021, 2019 and 2018.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Josh Hader throws a pitch

Josh Hader of the Brewers pitches against the Minnesota Twins at American Family Field, July 26, 2022, in Milwaukee, Wisconsin. (Stacy Revere/Getty Images)

Rogers was in his first season with the Padres before reportedly getting traded. He has a 4.35 ERA and 48 strikeouts in 42 appearances after becoming an All-Star for the first time in 2021 with the Minnesota Twins. Lamet was in his fifth season with the Padres. He posted a 9.49 ERA in 13 appearances.

Gasser, a pitcher, and Ruiz, an outfielder, were both on MLB Pipeline’s list of top prospects in the Padres organization.

The Brewers later announced the trade.

JUAN SOTO TRADE RUMORS: NATIONALS REPORTEDLY WHITTLE DOWN SUITORS TO THREE AS DEADLINE LOOMS

Taylor Rogers throws a pitch

Padres' Taylor Rogers throws against the Seattle Mariners, July 5, 2022, at Petco Park in San Diego, California. (Denis Poroy/Getty Images)

"The players we are receiving in this trade help ensure that the future of the Milwaukee Brewers remains bright while not compromising our desire and expectation to win today," Brewers' president of baseball operations David Stearns said.

"This mix of present Major League talent and high-level prospects furthers our aim to get as many bites of the apple as possible and, ultimately, to bring a World Series to Milwaukee. Trading good players on good teams is difficult, and that certainly is the case with Josh. We also recognize that to give our organization the best chance for sustained competitiveness, to avoid the extended down periods that so many organizations experience, we must make decisions that are not easy."

San Diego also announced a five-year contract extension with right-handed pitcher Joe Musgrove.

WHITE SOX'S TIM ANDERSON GETS THREE-GAME SUSPENSION FOR MAKING CONTACT WITH UMPIRE, APPEALS RULING

"Since joining the Padres, Joe has excelled as a pitcher, teammate and respected leader in the San Diego community," Padres chairman Peter Seidler said in a news release. "I have a great feeling knowing that Joe will be an important and significant part of our organization for many years to come."

Padres GM A.J. Preller added: "Joe has consistently performed at a high level over the last two seasons, throwing the first no-hitter in Padres history and becoming an All-Star. He personifies a championship-level mindset and elevates the teammates around him. We’re extremely happy to have Joe as part of our core group moving forward as we work to bring a World Series title to San Diego."

Joe Musgrove throws a pitch

Joe Musgrove of the San Diego Padres pitches against the Mets at Citi Field, July 24, 2022, in New York City. (Adam Hunger/Getty Images)

The Padres acquired Musgrove from the Pittsburgh Pirates as part of a three-team trade with the New York Mets in January 2021.

He’s become a solid starter for the Padres. He made his first All-Star Game this season. In 18 starts, he’s recorded a 2.65 ERA.

CLICK HERE TO GET THE FOX NEWS APP

The Padres didn’t disclose the financials of the agreement. ESPN reported his deal is worth $100 million.