The 35-year-old surpassed 1,000 Championship runs for the first time in his career last season, helping Somerset finish second to Middlesex.
Trego has played 207 first-class matches since his debut in 2000.
"2016 was such an exciting year for us all and in many ways increased my passion for the coming years," he said.
"Not only did we nearly reach the Holy Grail of the Championship, we witnessed all of our young talent become top-class performers."
Trego has scored more than 16,000 runs and taken over 600 wickets in all formats of the game during his career.
Somerset all-rounder Peter Trego has signed a new extension to his contract to keep him with the county until the end of the 2018 season.