Ryan Madson heading to Oakland

Ryan Madson has signed a three-year, $22 million contract with the Oakland Athletics, a source told ESPN's Jerry Crasnick.

The deal is pending a physical, the source said.

The 35-year-old Madson was a revelation this year for the World Series champion Kansas City Royals after spending time away from baseball. He moved into the seventh-inning role after signing with Kansas City in the offseason and, with Kelvin Herrera handling the eighth and Wade Davis the ninth, formed an effective and catchy back end of the team's vaunted bullpen.

"The key for us being able to do this, really, is the year Ryan Madson's had and Danny Duffy and his development in the pen," Royals manager Ned Yost said in October.

Madson fills a big need in Oakland's bullpen, which dealt with key injuries last season, including to closer Sean Doolittle, and had an American League-worst 4.63 ERA.

In a Wednesday trade with San Diego, Oakland acquired reliever Marc Rzepczynski, who later that night agreed to a one-year deal to avoid arbitration. Last month, the A's -- who missed the playoffs after three straight appearances -- signed left-hander Rich Hill to a one-year, $6 million deal to boost the rotation behind ace Sonny Gray.

"Arms are still a priority for us," A's general manager David Forst said this week ahead of the winter meetings in Nashville, Tennessee. "There are some other conversations that have unfolded. ... There's going to be plenty of conversation unfolding over the next 10 days as we get into Nashville."

The 6-foot-6, 210-pound Madson is 48-32 with a 3.47 ERA in 559 career appearances with the Royals and Philadelphia Phillies. He went 1-2 with three saves, a 2.13 ERA and 58 strikeouts in 68 relief appearances with Kansas City last season.

The Associated Press contributed to this report.