In a match heavily affected by swirling winds, the Robins started strongly and swept into a two-goal lead at the break courtesy of goals from Alex Revell and Ben Hutchinson.
Carl Cort pulled a goal back for Brentford with 13 minutes remaining, but Revell struck again before Charlie McDonald grabbed the hosts’ second goal.
Revell put Swindon ahead after just eight minutes, converting Jon-Paul McGovern’s cross from the tightest of angles, and Hutchinson then skipped past a static home defence to make it 2-0.
Cort slammed home a powerful strike from the edge of the box to give Brentford hope, but two minutes later Revell scored the goal of the game with a stunning angled drive from 25 yards that flew into the top-right corner.
McDonald headed home a Sam Saunders corner as Brentford fought back again, but Danny Wilson’s side held on to claim a valuable three points.