Warwickshire beat Somerset by two runs to win their first County Championship game.
Warwicks needed 136 runs to win with eight wickets in hand when the final day of this County Championship game at Edgbaston started.
The score had moved on to 145 when Ian Westwood was trapped lbw by Phillander after making 32.
Darren Maddy and Will Porterfield added 45 before Maddy was trapped lbw by Trego and seven runs later, Porterfield who had made 84 became Trego's second victim of the innings.
A ball later and Trego had his third wicket when Tim Ambrose was out for a golden duck to see Warwicks on 197-6 and what should have been a stroll turning into a tight finish.
Rikki Clarke added four runs before he was caught and bowled by Kirby and with Keith Barker hitting his wicket after scoring only one run, Warwicks were in trouble at 207-8.
Warwicks moved onto 216-8 at lunch with Jeetan Patel and Jim Troughton at the crease.
Patel took charge and hit three sixes to finish 43 not out and Troughton hit the winning runs with a four as Warwicks reached their target of 259 and won by two wickets.