(TNS) — Jason Hammel's rocky stint on the Royals pitching staff has come to a close after two seasons.

The Royals declined a $12 million option on Hammel on Tuesday, instead electing to pay a $2 million buyout of his contract. Hammel will become a free agent.

Hammel, who turned 36 in September, compiled a 5.59 earned-run average in his two years in Kansas City, including a 6.02 mark in 2018 that cost him a spot in the rotation.

The Royals signed Hammel to a two-year, $16 million contract before spring training in 2017. But after a successful stint with the Chicago Cubs, Hammel's career in Kansas City never blossomed. He was 12-27 in two seasons.

After struggling before the All-Star break this summer, he was eventually demoted to the bullpen, though he never appeared comfortable there, either.

The Royals are confident in their options within the rotation, with Danny Duffy, Jakob Junis, Brad Keller, Ian Kennedy, Jorge Lopez, Eric Skoglund and Heath Fillmyer all slated to return after starting at least 13 games last year.

"I feel like we got a lot of depth in the rotation," Royals general manager Dayton Moore said in a meeting with media earlier this month. "I like the fact that we have a lot more depth with pitching than we did at the beginning of the year with the draft picks and the trades we made as well."

Hammel was one of two players with an option tied to his contract. The Royals have until Wednesday to exercise a $3 million club option on Wily Peralta, who served as the closer for the final half of the season.