The Kansas City Royals and Danny Duffy agreed to terms on a five-year extension worth $65 million, according to Yahoo Sports’ Jeff Passan.  

The Royals formally announced the extension on Twitter:

The Kansas City Star‘s Rustin Dodd shared a yearly breakdown of the contract:

Duffy was under team control for one more season before he was set to become a free agent next winter, per Spotrac.

The 28-year-old left-hander went 12-3 with a 3.51 ERA in 42 appearances for the Royals in 2016. He began the year in the bullpen before making his first start May 15 and emerging as the Royals’ ace.

According to FanGraphs, Duffy finished with a 3.56 ERA and 3.99 FIP in 26 starts, both of which were the lowest among Kansas City’s regular starting pitchers. Duffy also averaged a career-best 9.42 strikeouts and 2.10 walks per nine innings.

With major question marks over the starting rotation, re-signing Duffy was a great move for Kansas City. Edinson Volquez signed with the Miami Marlins, Ian Kennedy was disappointing in the first year of his five-year deal, and Yordano Ventura took a big step backward in 2016.

Keeping Duffy for the next five years stabilizes the staff, and an average of $13 million is a more than reasonable salary. He won’t even be the highest-paid starter. Kennedy, who is four years older, will earn an average of roughly $15.6 million for the next four seasons, per Spotrac.

ESPN.com’s Dan Szymborski tweeted that Duffy’s deal gives the Royals some flexibility:

Kansas City made back-to-back World Series in 2014 and 2015, winning a title the second time around, but general manager Dayton Moore said in October he expected the team’s payroll to “regress a little bit” after the Royals spent relatively big in pursuit of a World Series ring, per Dodd.

Duffy’s extension is evidence, however, that Kansas City’s ownership is still willing to invest in the team to ensure it remains competitive in 2017 and beyond.

Read more MLB news on BleacherReport.com