Team owner Paul Allen confirmed Wagner's extension on his Twitter account on Saturday night. The deal is worth $43 million, making him the highest-paid middle linebacker in football, according to NFL.com.
Signing Wagner and quarterback Russell Wilson, both of whom are entering their fourth seasons in the league, to extensions were top priorities for the Seahawks this offseason.
Wagner's deal became a challenge after the team signed Wilson to a new contract worth $87.6 million. That deal included a signing bonus of $31 million, according to Wilson's agent, Mark Rodgers, bringing Wilson's cap number over $8 million.
The Seahawks were hoping to get a cap number around $5 million for Wilson and $3.5 million for Wagner.
After Wilson signed, Wagner said he considered holding out but decided to show up for the start of Seahawks training camp and avoid paying a fine.
Wagner was an All-Pro last season and has been the Seahawks' starting middle linebacker since being a second-round pick in 2012.
Asked if it was important to be the highest-paid linebacker, Wagner said, "It's important to be recognized as one of the best."
With Wagner's extension signed, most of Seattle's top defensive players are now under contract for at least the next three years, including cornerback Richard Sherman and safeties Kam Chancellor and Earl Thomas.
Information from The Associated Press and ESPN NFL senior writer John Clayton was used in this report.