Karl Sheppard struck the only goal of a thrilling Terryland Park game as Galway United preserved their top flight status.
It proved to be a thrilling contest in the west as Galway ruled vast chunks of the contest with Republic of Ireland under-21 international Seamus Conneely the star performer.
Galway, who made 10 changes from the side that had drawn with Drogehda United at Hunky Dorys Park, were keen to involve the returning Stephen O'Donnell at every opportunity.
But Bray were determined early on moving the ball forward quickly and they carved a decent third minute chance.
Dane Massey's deep cross found Gary Shaw, but the imposing striker was unable to direct a header on target from 12 yards.
As the half evolved Galway became more confident and composed as Conneely provided the midfield industry.
The Tribesmen's passion was rewarded in the 16th minute when Karl Sheppard swept home an opportunistic goal.
Derek O'Brien's head connected with a Jamie McKenzie cross and though Matt Gregg saved Sheppard netted from the rebound.
The remainder of the first half was well controlled by Conneely, who supplied the midfield guile as Galway went in ahead at the interval.
Galway created chances after the restart too and a mazy O'Brien dribble nearly ended with a goal, but the busy wide man shot wide.
Then a sweeping Galway move involving substitute Tom King and O'Donnell saw the ball switched to O'Brien, who blazed over.
In the closing stages Bray's Adam Mitchell was sent off on 82 for a foul on Sheppard while O'Brien also saw red in stoppage time for kicking the ball away.
Galway United: Ryan; Sinnott, McKenzie, Meynell, Walsh; Curran, Conneely, O'Donnell, O'Brien; Molloy (King, 72, Keane, 90), Sheppard.
Bray Wanderers: Gregg; Doyle, Mitchell, Webster, Massey; G Kelly (Tresson, 77), D O'Connor, Dempsey, J Kelly; Shields (O'Neill, 46), Shaw.
Referee: D Hancock (Dublin)