The Kansas City Royals and starting pitcher Homer Bailey reached an agreement on a contract Saturday following his release by the Los Angeles Dodgers in December.

Per The Athletic's Rustin Dodd, Bailey received a minor league deal from the Royals with an invitation to spring training. 

Bailey spent the first 12 years of his MLB career with the Cincinnati Reds before getting dealt to L.A. in December as part of a blockbuster trade that saw outfielders Matt Kemp and Yasiel Puig and starting pitcher Alex Wood head to Cincy. He was immediately released.

The 32-year-old right-hander has been one of baseball's worst starters in recent years. He finished the 2017 season with a 6.34 ERA and 1.69 WHIP across 18 starts and only slightly improved on that poor performance last year, posting a 6.09 ERA and 1.64 WHIP in 20 outings.

In September, Bailey was dropped from the Reds' rotation and turned down an opportunity to join the bullpen because he wasn't comfortable with changing roles amid an ongoing season, per Joe Kay of the Associated Press. The starter also lamented his consistent struggles.

"It was frustrating in April," he said. "It's like normal now."

Bailey's overall track record is better. He has a 4.56 career ERA, including a career-best 3.49 mark in 2013, but he's failed to make much of a positive impact since 2015 because of injuries and lackluster numbers.

Signing Bailey is nothing more than a long shot flier for the Royals. He never developed into the ace the Reds expected when they selected him with the seventh overall pick in the 2004 MLB draft, and he's struggled mightily as of late.

A team such as the Royals is the best fit for Bailey. They are still in the early stages of rebuilding mode after going 58-104 in 2018. Their starting rotation heading into spring training, which begins Tuesday, is a mess, with Danny Duffy, Brad Keller, Jakob Junis and Ian Kennedy in the top four spots. 

Bailey should compete with pitchers such as Jorge Lopez and Heath Fillmyer for the final spot in Kansas City's rotation to start 2019.