Wainwright had been eligible to become a free agent after the World Series.
The new agreement, first reported by foxsports.com, was confirmed by a person familiar with the negotiations who spoke on condition of anonymity because it had not yet been announced. The Cardinals scheduled a news conference for Thursday at their spring training camp in Jupiter, Fla.
A 31-year-old right-hander, Wainwright was 14-13 with a 3.94 ERA last year after missing the Cardinals' World Series championship season in 2011 because of elbow surgery.
Wainwright was 20-11 with a 2.42 ERA in 2010 and was an NL All-Star.