In 2012 he was traded twice, landing on the Royals in July. He proved to be the best pitcher for the Royals in the second half of the season, posting a 3.16 ERA and a 5–3 record. In 2014 he made his only appearance in the postseason, including two starts in the 2014 World Series against the San Francisco Giants, going 1–1. After becoming a free agent at the end of the 2015 season, he signed multiple minor-league contracts before being released each time. In 2017, he signed with the Nationals and appeared in one game before being released.