Thomas helped reduce Sussex from 33 for no wicket to 33 for five on the third day of his county's match against Sussex at Taunton.
He bowled James Anyon, trapped Rory Hamilton-Brown leg before and had Ed Joyce caught behind for his first first-class hat-trick.
And with the first ball of his next over the 37-year-old, who represented his country in one Twenty20 international in 2007, bowled Matt Machan off an inside edge.
Although Sussex steadied the ship to move to 104 for five after lunch, the visitors lost regular wickets thereafter - including another to Thomas, who had Luke Wright caught at second slip for a joint-top score of 35.
The South African finished with five for 40 as Somerset won by six wickets.
Thomas was elated after becoming the first bowler to achieve the four-in-four feat in the County Championship since Gary Butcher, for Surrey against Derbyshire in 2000.
"Today has got to be right up there for me. I have had a lot of nerve-wracking moments with Somerset, been involved with bowl-outs so it was just nice to take four wickets, and I was very happy to do that," he told the club's website (www.somersetcountycc.co.uk).
"This is my first first-class hat-trick, my first as a professional cricketer, and to then take four and be one of only a few to have done it is good.
"I have never seen anything like that all the time that I have played and I am just really happy with the performance and a to take four in four was a fantastic special day for me."
After Thomas had completed his hat-trick, fellow bowler Pete Trego took the wicket of Chris Nash before Thomas took his fourth with his next ball.
(Writing by Stephen Wood and Neville Dalton, editing by Tony Jimenez)
Share
