The first will be in the first playoff at Millbrae on Saturday after Ayr denied them home advantage with a narrow and engrossing win at The Greenyards in their final league fixture.

The second, if they win that game, will be against Heriot’s or Currie in the final itself, now expected to be on April 25.

After a frustrating defeat, in which Melrose emerged a 'new’ side after the break, coach John Dalziel admitted: “In the first half, we were not good enough. We gave Ayr two converted tries, which they did not have to work very hard for.

“We had to work hard to break down the Ayr defence. We will go to Ayr and the boys will want to make amends. We showed enough in the second half what we can do. A league decider or a semi-final, if you cannot get up for that…” Melrose will need to show more composure than they did on Saturday. They were snuffed out in the first 40 minutes and then made too many mistakes as they upped the tempo in the second.

Both sides played their better rugby into the wind as Ayr led 14-3 at the interval, but Melrose made three changes before the start of the second half, bringing on Todd Pearce, Ruaridh and Tom Galbraith, as well as Huge Blake, to score two tries in the first 20 minutes only to be defied by magnificent defensive play.

Even with the gale behind them in the first half, Melrose played second fiddle to an Ayr side, which edged ahead in seven minutes when Robbie Fergusson took Dean Kelbrick’s pass to score and Grant Anderson converted.

Melrose responded with a Richard Mill penalty, but eight minutes from the interval, Ayr seemed to have closed the game out as Danny McCluskey touched down and again Anderson added the goal points.

On the restart, James Head was driven over and with 20 minutes left, Blake cut the gap to one point. It was then that Ayr performed heroics in defence to stuff out the Melrose challenge.

Anderson missed two kicks at goal to close out the game while Mill came back on to also miss what could have been the winning penalty.

Robert McAlpline and then Graeme Dodds were each sent to the sin-bin before referee Graham Wells blew the final whistle in the fifth minute of injury time and Melrose knew they faced a daunting journey to Ayr.

Melrose: F. Thomson; B. Colvine, A. Lockington, T. Mua; R. Mill, M. McAndrew; N. Beavon, R. Ferguson, E. McQuillin, J. Head, L. Carmichael, N. Irvine-Hess, G. Dodds, G. Runciman. Replacements: N. Pearce, N. Little, R. Knott, H. Blake, T. Galbraith.