The 33-year-old has spent his entire professional career at Taunton and has developed into an important player for the county across all three formats.
He is "absolutely delighted" to have signed a new deal and feels that he can still improve as he reaches the latter stages of his career.
"I am absolutely delighted and with the way that I have been playing, I think my consistency is improving year in, year out," Trego told Somerset's official website.
"I train hard in the gym and I am feeling really fit and strong. Actually, I feel that at 33 years of age I haven't hit my straps yet and I'm really excited for the next few years.
"I'm delighted that my skills will be on show with Somerset at the County Ground in Taunton."
Trego made his Somerset debut in 2000 and was part of the squad which won the Twenty20 Cup in 2005.
He averages over 30 with the bat in both first-class and domestic one-day cricket, and has taken 560 wickets across all formats.