The Brumbies looked like winning a battle of the best teams from either side of the Tasman Sea when hooker Billy Pollard crashed over the line off the back of a rolling maul in the 77th minute of a contest played at almost test match intensity.
The Blues turned the ball over, however, and made their way down to the home side's line and, with the referee playing advantage, All Blacks first five-eighth Barrett calmly took the three points to give his side a 12th straight win.
"The boys dug in," said Blues skipper Dalton Papalii. "Their defence was bloody hard to get through and it came down to the wire. That was a gritty win for the lads."
Barrett and prop Karl Tu'inukuafe also scored tries for the Blues, who hold a six-point cushion at the top of the standings going into the next week's final round of the regular season.
The Brumbies, who scored an early try through Pete Samu and another off the rolling maul from starting hooker Folau Fainga'a, were left counting the cost of poor discipline after being heavily penalised and shown two yellow cards.
They will take some solace, however, from the fact that they matched the best New Zealand side blow-for-blow in a brutal match, stalling the powerful Auckland machine and almost snatching the win.
The defeat meant a drop to third in the standings behind the Crusaders, who routed Fijian Drua 61-3 on Friday night in the first of several one-sided contests in round 14.
Earlier on Saturday, Quinn Tupaea scored a hat-trick as the Chiefs romped past Western Force 54-21 in Hamilton to remain in fourth with the Hurricanes snapping on their heels after a 45-22 win over the Rebels.
The Waratahs visit the Highlanders, who are already assured of at least the eighth and final playoff spot, in the last match of the round in Dunedin on Sunday.
It was a worrying day for the All Blacks selectors with both Chiefs captain Sam Cane and powerful Blues winger Caleb Clarke forced out of their contests by injuries.
Photo: Photosport / Andrew Cornaga Caption: Beauden Barrett sealed victory for the Blues.