49ers sign Andy Lee through 2018

The San Francisco 49ers have signed three-time All-Pro punter Andy Lee to a six-year contract extension through the 2018 season.

The 49ers announced Lee’s extension Wednesday. San Francisco selected Lee in the sixth round of the 2004 draft with the 188th pick overall.

The 29-year-old has played in 128 games for the 49ers and holds team records in punts (723), yards (33,069), gross average (45.7), net average (38.9) and punts downed inside the 20-yard line (209). Since 2007, Lee’s gross punting average (47.9) and net average (40.7) rank second in the NFL.

Lee set the NFL single-season record last year in net punting average (44.0), and his gross average (50.9) ranked third in NFL history.