A few light showers earlier in the day hadn't made the pitch too greasy, and the sun was out, but it was windy all afternoon, not that the weather put off the Ayr fans who had travelled down to cheer on their players.
They had plenty to shout about right at the start as captain, and eventual man of the match, Pete McCallum made one of his customary blasts for the line, with scrum-half David Armstrong in support but he was bundled into touch.
There were some early fumbles from both teams as nerves seemed to play apart on such a big occasion, but Ayr settled down the quickest. Second row Scott Sutherland led an initial attack, with McCallum and Archie Russell. The latter's centre partner Stafford McDowall stepped in to take the ball, McCallum again reappearing with flankers Will Bordill and Blair Macpherson on hand to help out.
Second Robert McAlpine and the mobile front row of Goerge Hunter, Lewis Anderson and Steven Longwell got in on the attack too but those wily old foxes in black and yellow turned over.
From a penalty line-out, the home team had their first proper go at attack, captain Grant Runciman leading the way with centre Craig Jackson, but Ayr's defence held firm and they pinned Melrose in their own half.
Hearts were in mouths for Ayr fans, but their team scrummed well and defended bravely as Melrose pressed for the five points, hooker Anderson putting in a thumping tackle. The visitors were caught offside and stand-off Jason Baggott stepped up to the tee for the first points. 3-0.
Ayr let loose along the wing through Craig Gossman but his chip ahead came to nothing. It was then McCallum's turn again to go for the line, with Longwell showing an impressive side-step to make for the whitewash.
Hunter, Russell, McDowall and stand-off Frazier Climo fired the ball through the hands but it sailed off the pitch. Referee Mike Adamson took them back for a high tackle on Gossman and Climo leveled the scores. 3-3.
A line-out for Ayr was the perfect platform for McDowall to tear through midfield on an exciting run but a tackle dislodged the ball. Melrose were solid at the scrum but came undone moments later thanks to some bulldozing counter-rucking by Macpherson.
A penalty was awarded and Climo put Ayr into the lead. 3-6.
Melrose's experienced full-back Fraser Thomson could see just a chink in Ayr's defence and was off like a rocket until Armstrong's superb cover tackle dragged him into touch.
The scrum-half was all over everything, launching Ayr's attack moments later and then hoisting a box-kick high into the Borders sky which was then knocked on by Melrose's George Taylor.
From the ensuing scrum, winger Danny McCluskey tried to make a break, but Ayr's top try-scorer for the season was heavily marked all game. Sutherland showed a deftness of touch to keep the ball moving but it ended up in Melrose hands only for the hosts to knock it on.
Climo stretched Ayr's lead after being flattened by Melrose prop Nick Beavon. 3-9.
Whether it was those pesky nerves or they were just cancelling each other out, neither team looked likely to score a try at the start of the second half.
A beautiful kick for touch from Melrose's Thomson gave Ayr a line-out which the hosts managed to poach. They couldn't get very far as Hunter wrapped up number eight Iain Moody in a bear-hug of a tackle.
Melrose's penalty count was creeping ever higher and the referee played advantage after another high tackle on Gossman. Climo took the opportunity to get creative, chipping over and catching the ball with ease, Armstrong, McCallum, Russell and McDowall displaying good hands too.
But eventually, they went back for the penalty, which Climo summarily kicked. 3-12.
Baggott took a kick at goal after Ayr were pinged for not rolling away but he missed.
At the re-start, Gossman took a flying leap on to Climo's kick and propelled himself up the touchline but the ball later went loose.
Thomson and Runciman were Melrose's danger men again but McCluskey and McDowall put in the big hits to bring them down. Nobody could stop second row Ruaridh Knott, however, as he plunged for the try-line to send the home fans wild. Baggott couldn't add the conversion from out wide. 8-12.
Bordill took his leave after another gut-busting shift in the pink and black shirt and was replaced by Gregor Henry, who set to work immediately.
To say the tension was palpable was an under-statement. The crowd was getting riled up and so were the players, but discipline was generally good and emotions didn't spill over until any unnecessary unpleasantness.
Melrose suddenly seemed to have shaken off their stage fright, Thomson rallying his team-mates and giving the crowd palpitations with a kick over the try-line. Luckily for Ayr, it was Gossman who touched it down.
Melrose kept going for the corner and kept taking the ball well at the line-out. They just couldn't get over the line though. Ayr were defending their hearts out, holding them back and then holding them up.
Everyone was piling in, replacements Djustice Sears-Duru and David Young adding some energy to the defence. But the referee yellow-carded McCallum for illegally collapsing the maul.
Melrose could scent a late triumph. There were forty seconds left on the clock. They had the man advantage. They had the home advantage. They had the line-out. Ayr had Scott Sutherland.
The wise head of the pack leapt in front of the Melrose jumper and knocked the ball to his forwards. Hunter took care of it until it was fired back to Climo and he booted it off the park to bring the game to an end.
Ayr celebrated a tough, dogged, hard-fought victory, but they also commiserated with their Melrose counterparts, knowing how difficult it is to make a play-off final as league leaders and be denied the title at home.
Melrose were tenacious opponents and head coach Robert Chrystie and his on- and off-field teams must be commended for a terrific season full of entertaining and commanding performances that showed the very best of the BT Premiership.
Ayr head coach Calum Forrester was almost speechless, but not quite. "I'm delighted. I just want to thank the players and coaches for their efforts."
Man of the match: Pete McCallum.
- Elena Hogarth.
All photos copyright George McMillan. Please seek permission before reproducing for commercial purposes.