Sometimes it all comes together just as it should and the sight of Gavin Rae raising the SPFL Championship trophy was one of those occasions at Dens Park on Saturday.

An Aberdonian by birth, the midfielder is dark blue through and through having started his senior playing career as a teenager with Dundee. Now, at 36, he seems certain to have ended that career on the greatest day in the Dens Park club's recent history.

Good enough to be among those rare few players to have been capped by Scotland while at Dundee, that first, eight-year stint, encompassed the weirdness of the recruitment of renowned names which helped the team to a Scottish Cup final in 2003 before it all unravelled.

A brief loan period two seasons ago had made this Rae's third spell at the club. That meant supporters could revel in the additional pleasure of witnessing one of their modern greats take centre stage on Saturday after their team set up what will be a unique season for football in the city.

"It's a very emotional day," said the Dundee captain. "I'm just absolutely delighted for everyone involved with the club that we managed to get over the line.

"It's possibly my last game. I'll have to have a wee think. It's been in my mind and if it is my last day then it's unbelievable. You couldn't write it any better. The aim when I came back was to get promotion and we did it."

Meetings with city rivals United will be among Scotland's biggest fixtures next season and Rae's experience makes him well-placed to comment on their significance. "[Dens Park] was sold out on Wednesday which shows just how much this club means to people," he said.

"It's a huge club in Scotland. It's so well supported. They've turned out the whole season, but especially this week. Knowing there was something big at stake they've got along early and I'm delighted for them. It shows you the city is on the up and this club deserves to be in the top league."

Rae was blissfully unaware of how close his side came to missing out on a return to the top flight until after the match, with Hamilton Academical also winning on Saturday to finish the season just two points behind the Dens Park side. "I didn't know until I got back into the dressing room and I was actually shocked at the score," Rae said of the result between their title rivals and Morton, which ended with Hamilton winning 10-2.

"It just shows you how pivotal that save was by big Kyle [Letheren, the Dundee goalkeeper] towards the end of the game. That was crucial for us. I was actually right behind it and it was an unbelievable save."

Paul Hartley's determination to focus on keeping matters in their own hands was proved right, albeit the Dundee manager subsequently joined the few in sport to apply correctly the overused adjective "incredible".

"I wasn't aware what was happening. It wasn't until I came in after the game and found there had been a strange result," said Hartley of Hamilton's win. "It's an incredible one to be honest with you."

Had Dumbarton equalised he might have felt otherwise, but the manager who has now steered teams to three successive promotions after two with Alloa Athletic, stopped short of calling for an inquiry. "I'm just saying it's a strange result," said Hartley, when invited to do so, grinning mischievously.

Since it really had been impossible beforehand to believe that a point would not be enough for Dundee to win the title - such was their superior goal difference - it should all have been over after Christian Nade and Peter MacDonald scored goals in the first half.

This being Dundee, though, there was a sense that many fans were thinking that, even then, calamity was not too far away. There had, too, been eyebrows raised at the news that Hamilton had scored twice very early on and, as unlikely as getting an eight-goal win when it was required might have seemed, the fact that the Lanarkshire side were halfway there at the interval heightened a feeling of trepidation within Dens Park.

When Dumbarton were quite rightly awarded a penalty, rammed in by Scott Agnew, it was also filtering through that Hamilton were playing shooty-in. The conga in the Derry section of Dens stopped in its tracks. One goal for Dumbarton would change everything.

Referee Bobby Madden then made the decision not to award the visitors a penalty when Chris Kane was felled in the box, which looked a poor call at the time.

Ian Murray, the Dumbarton manager, seemed entitled to feel hard done by, yet, with everything else that was taking place, that decision and Letheren's superb save from Bryan Prunty's firm downward header, probably prevented a riot.

Instead the pitch invasion was a joyous one, while what threatened to become a wounded outcry was thankfully reduced to dark murmurings which, such is football, only seemed to add to the satisfaction among the gleeful in packed Dundee pubs on Saturday night.