He is only the 13th player to achieve the feat as Alex Kennedy (3), Stuart Boyes (2) and Butch White (2) did it more than once.
Abbas, who picked up 6-11 as Middlesex were routed for just 79, is the third Hampshire player to have taken three wickets in three balls in a Championship game in the last four years.
Kyle Abbott performed the feat against Worcestershire in 2018 and James Fuller repeated it during last year’s Bob Willis Trophy victory against Surrey at Arundel.
Abbas’ achievement was the first Championship hat-trick by a Hampshire player at The Ageas Bowl since Billy Taylor did it in 2006.
Middlesex were also the opponents that day, Taylor ending up with a career best 6-32 as the visitors were skittled for 98 on the first day.
Middlesex’s 79 is the third lowest first class total at The Ageas Bowl
The only lower ones both came in the same game in 2017 when Essex were skittled for 76 in their first innings and Hampshire for the same score in their second innings.
It was Middlesex’s third lowest Championship total against Hampshire, after 59 all out at Lord’s in 1956 and 78 all out at Burnaby Road, Portsmouth, in 1933.
There have only been five first class totals of under 100 in The Ageas Bowl’s 20-year history, and Middlesex are now responsible for two of them (98 all out, 2006).
Abbas said: ‘It's a great day for me. I took two wickets and before I bowled for my third wicket I realised Ramadan is going on and that is lucky for us and Friday is a day that is lucky for me.
‘I have played here before when I was with Pakistan and the pitch had something in it for me and I bowled on point in the right areas.’
Middlesex batsman Max Holden said: ‘There is a lot of gutted guys in the dressing room at the moment.
‘The bowlers put a lot of effort and toiled hard on what is a pretty decent cricket wicket and controlled the run rate well.
‘It was the turn of the batters to step up but we didn't deliver.
‘Mohammad Abbas is a world-class bowler but as far we are concerned there is no excuse for getting bowled out for 79 on that wicket.’