Former Philadelphia Phillies closer Ryan Madson has agreed to a minor league contract with the Kansas City Royals that includes an invitation to major league spring training camp, the team announced Sunday.

Madson, 34, is 47-30 with a 3.59 ERA and 52 saves in eight career seasons with Philadelphia. He hasn't pitched in the major leagues since 2011 because of elbow problems.

Ryan Madson went 47-30 with a 3.59 ERA and 52 saves in eight career seasons with Philadelphia. Howard Smith/USA TODAY Sports

Madson assumed the closer's job in Philadelphia from Brad Lidge in 2011 and saved 32 games, but a reported four-year, $44 million deal fell through and sparked a disagreement between Phillies general manager Ruben Amaro Jr. and Madson's former agent, Scott Boras.

The Phillies quickly changed course in November 2011 and signed Jonathan Papelbon to a four-year, $50 million deal.

Madson signed a one-year, $8.5 million contract with the Cincinnati Reds, but he underwent Tommy John surgery in spring training and missed the 2012 season. He made a failed comeback attempt with the Los Angeles Angels in 2013 and sat out the entire 2014 season.

Madson has two connections in the Kansas City front office. Jim Fregosi Jr., now a special assistant to Royals general manager Dayton Moore, was the scout who signed Madson out of the 1998 first-year player draft with the Phillies. Mike Arbuckle, currently a senior advisor in Kansas City, was Philadelphia's scouting director in 1998 when the Phillies selected Madson in the ninth round of the draft.