The 31-year-old was 9-15 with a 4.28 ERA and 174 strikeouts for the San Diego Padres last season. He has made 30 or more starts in each of the past six seasons.
The deal, earlier reported by MLB Network, is contingent on Kennedy passing a physical and includes an opt-out after the first two years.
The Royals were seeking another starter to replace Johnny Cueto, who signed a $130 million, six-year deal with the Giants after helping Kansas City win its first World Series since 1985.
Kennedy turned down the Padres' qualifying offer -- a guaranteed $15.8 million salary for next season. That means San Diego will receive a draft pick from Kansas City as compensation.
The right-hander entered the majors in 2007 and spent three seasons with the New York Yankees before joining the Arizona Diamondbacks in 2010 as part of a three-way trade that also included the Tigers. He was traded to the Padres in 2013.
In nine seasons, Kennedy is 75-68 with a 3.98 ERA and 1,140 strikeouts.
The Royals hope Kennedy can return to form under pitching coach Dave Eiland, who has worked wonders with Edinson Volquez, Yordano Ventura and others over the years. Kennedy and Eiland are familiar with each other after their years in the Yankees system.
Kennedy should also benefit from pitching in spacious Kauffman Stadium. While his strikeout rate was among the best in the game last season, he also allowed 31 homers in just 168⅓ innings.
He figures to slide into the middle of the rotation behind Volquez and Ventura and ahead of Kris Medlen and Chris Young. The Royals also have Danny Duffy and Dillon Gee, among several others, who stand to compete for the fifth spot throughout spring training.
Heralded prospect Kyle Zimmer could also be in the mix later in the season.
Long considered frugal, the Royals have spent lavishly the past couple of years, a signal that the small-market club views the next two years as a prime opportunity to win another championship.
Already this offseason, the Royals brought back All-Star outfielder Alex Gordon on a $72 million, four-year contract. They signed former closer Joakim Soria to a $25 million, three-year deal, avoided the next two years of arbitration with All-Star outfielder Lorenzo Cain by agreeing to a two-year, $17.5 million deal and brought back Young on an $11.5 million, two-year deal.
Throw in an $8 million option on All-Star closer Wade Davis and a $5.25 million option on All-Star shortstop Alcides Escobar, along with significant raises for their arbitration-eligible players, and the Kansas City payroll could reach a franchise-record $140 million next season.
"We're going to continue to work our roster, massage it in ways that are going to help us win," general manager Dayton Moore said recently. "If you look at the evolution of the 2015 roster, we made adjustments along the way, and I'm confident we're going to be able to do that."
The Associated Press contributed to this report.