Media playback is not supported on this device
A beautifully controlled half-volley from Jonny Hayes after nine minutes was reward for a fine Dons start.
But Celtic were level within two minutes as Stuart Armstrong was given too much time to pick out the far corner from the edge of the box.
Late Celtic pressure paid off as Rogic fired low past goalkeeper Joe Lewis.
A thrilling 90 minutes concluded with Celtic not only lifting the cup for the first time since 2013 but becoming the first side in Scotland to complete an unbeaten treble.
It is the 37th time the Hoops have lifted the world's oldest national football trophy and the fourth time they have won the treble - and their first since 2001.
Derek McInnes' Dons, looking to end a 27-year wait to win the competition for an eighth time, were left as runners-up to Brendan Rodgers' side in the Premiership, the League Cup and now the Scottish Cup.
It was a pulsating cup final right from the start, Aberdeen coming out with an edge to their play that put their illustrious rivals on the back foot.
Yes, Rodgers' team had won five out of five in the head-to-heads this season, with an aggregate score of 12-2, but this was an altogether different Dons to previous versions.
In this classic, they were a team reborn.
In the beginning, they harried Celtic's go-to men. Graeme Shinnie and Kenny McLean were commanding.
They lived in their faces defensively and showed plenty offensively. The feeling was that Aberdeen had to take the lead to make a true fight of this final and that is precisely what they did.
Having shipped three early goals to Celtic in their last meeting, the Dons changed the narrative.
From a Niall McGinn corner, Hayes came round the blindside of Leigh Griffiths and smashed a volley past goalkeeper Craig Gordon and beyond Kieran Tierney on the line.
It was a goal of quality and a goal that electrified the huge Aberdeen support.
Celtic are champions, though, and their true selves emerged only two minutes later when Aberdeen unwisely stood off Armstrong, who thumped in the equaliser low to Lewis's left.
Two early goals and the intensity only cranked up from there. Midway through the half, there was controversy.
Jayden Stockley - selected up front ahead of Adam Rooney - swung an arm into Tierney's face and the young Celtic full-back immediately signalled that he was in bother.
Blood poured from his mouth and, after treatment, he had to leave the field.
Stockley has a reputation for over-zealous use of his arms and elbows and was deeply fortunate not to see red for a fourth time this season. He claimed it was accidental, but Celtic were having none of it. They were incensed.
Callum McGregor shifted to left-back and Rogic came into the final and things went up another level.
Gordon made a double save in quick order and then made another from a Stockley header.
Celtic were rattled, they were totally unable to get a hold of the game in the face of the Dons' aggressive edge.
It was Celtic, however, who should have gone ahead just before the break when a delicious Griffiths delivery was put over from point-blank range by Scott Sinclair.
The toe-to-toe nature of the contest carried on brilliantly. Griffiths and Sinclair went close then Aberdeen swept downfield on a breakaway and a priceless chance was wasted.
Hayes had mugged McGregor down the right and, with McLean running free in the box, all they had to do was get their communication right and a goal was certain.
They didn't. Hayes hit his pass slightly behind McLean and the midfielder couldn't hook it in. Agony for Aberdeen.
Celtic then moved up a gear and now it was the Dons pinned on the ropes. Lewis pushed a Patrick Roberts shot on to his post.
From the resulting corner, Celtic's Mikael Lustig tugged the ball just wide. The game opened up as wide as the Clyde.
Aberdeen's Ash Taylor headed away from under his own crossbar, Dedryck Boyota headed just over, Gordon made a fine save from Shinnie and then it was Lewis's turn again, saving wonderfully from Griffiths. Lewis was immense for the Dons.
As the final wore on, Celtic took an ever-tightening grip.
Rodgers' side pressed and pressed and a tiring Aberdeen threw their bodies in front of shots to keep alive. Their scrambling defence was constant and heroic.
But it wasn't enough. With all at Hampden steeling themselves for extra-time, Rogic ran at Aberdeen down the right, going past the utterly jaded Andrew Considine and slamming his shot low under Lewis. Extraordinary.
The heartbroken Dons had made it a mighty battle, but Celtic showed their incomparable will and their domestic greatness.
The history makers had done it again. A treble won. Truly, they are something special.
Match ends, Celtic 2, Aberdeen 1.
Second Half ends, Celtic 2, Aberdeen 1.
(Celtic) wins a free kick in the defensive half.
Foul by Adam Rooney (Aberdeen).
Attempt saved. Ash Taylor (Aberdeen) header from the centre of the box is saved in the centre of the goal.
Substitution, Celtic. Erik Sviatchenko replaces Patrick Roberts.
Substitution, Aberdeen. Scott Wright replaces Ryan Jack.
Tomas Rogic (Celtic) is shown the yellow card for excessive celebration.
Goal!  Celtic 2, Aberdeen 1. Tomas Rogic (Celtic) right footed shot from the right side of the six yard box to the bottom left corner. Assisted by Mikael Lustig.
Corner,  Celtic. Conceded by Mark Reynolds.
Attempt missed. Scott Sinclair (Celtic) right footed shot from the right side of the box is close, but misses the top right corner.
Attempt missed. Callum McGregor (Celtic) right footed shot from outside the box misses to the left.
Stuart Armstrong (Celtic) wins a free kick in the attacking half.
Foul by Shaleum Logan (Aberdeen).
Corner,  Celtic. Conceded by Anthony O'Connor.
Attempt blocked. Patrick Roberts (Celtic) right footed shot from the centre of the box is blocked.
Attempt missed. Leigh Griffiths (Celtic) left footed shot from outside the box is close, but misses to the right.
Attempt blocked. Patrick Roberts (Celtic) right footed shot from outside the box is blocked.
Attempt saved. Scott Sinclair (Celtic) left footed shot from the centre of the box is saved in the centre of the goal.
Attempt missed. Leigh Griffiths (Celtic) left footed shot from the right side of the box is close, but misses the top left corner.
Attempt saved. Leigh Griffiths (Celtic) right footed shot from the centre of the box is saved in the bottom left corner.
Substitution, Aberdeen. Anthony O'Connor replaces Niall McGinn.
Foul by Patrick Roberts (Celtic).
Graeme Shinnie (Aberdeen) wins a free kick on the left wing.
Corner,  Aberdeen. Conceded by Craig Gordon.
Attempt saved. Graeme Shinnie (Aberdeen) right footed shot from outside the box is saved in the bottom right corner.
Corner,  Aberdeen. Conceded by Callum McGregor.
Attempt missed. Dedryck Boyata (Celtic) header from the centre of the box is just a bit too high.
Corner,  Celtic. Conceded by Ash Taylor.
Foul by Jozo Simunovic (Celtic).
Jonny Hayes (Aberdeen) wins a free kick on the right wing.
Attempt missed. Leigh Griffiths (Celtic) right footed shot from outside the box is too high.
Attempt missed. Jonny Hayes (Aberdeen) right footed shot from outside the box is too high.
Foul by Scott Brown (Celtic).
Graeme Shinnie (Aberdeen) wins a free kick in the attacking half.
Attempt missed. Mikael Lustig (Celtic) right footed shot from the centre of the box is close, but misses to the right.
Corner,  Celtic. Conceded by Joe Lewis.
Patrick Roberts (Celtic) hits the left post with a right footed shot from outside the box.
Attempt saved. Stuart Armstrong (Celtic) right footed shot from the left side of the box is saved in the centre of the goal.
Substitution, Aberdeen. Adam Rooney replaces Jayden Stockley.
Celtic completed a domestic treble without losing a game as Tom Rogic fired in a stoppage-time goal against Aberdeen to win the Scottish Cup.