In a game that finished with a total corner count of 20, it was no surprise that a set-piece led to the only goal at the Carlisle Grounds last night.
The real shock was the fact that the crucial strike went in favour of the hosts, with David Scully's thumping header condemning Dundalk to their first defeat since the opening day of the season.
The outcome may have ended with plenty of betting slips being torn up, but the result was a fair one, with Bray Wanderers fully deserving of the three points that propels them up to seventh.
Dundalk's best efforts came from David McMillan. The striker forced Bray goalkeeper Stephen McGuinness into a good stop in the sixth minute before his goalbound effort was cleared off the line by Dave Webster in the 42nd minute.
It was Peter Cherrie who was the busier of the two goalkeepers. The Scot produced a spectacular save to turn Shane O'Neill's equally eye-catching volley over the top in the 23rd minute before denying Ismahil Akinade eight minutes later.
Dean Zambra was next to have a pop, Cherrie springing from his line to smother the midfielder's close-range strike.
The natives continued to pose problems after the break and Towell stopped an Akinade shot from finding the net.
Bray continued to expose Dundalk and they got the goal they deserved in the 65th minute when Scully steamed in to meet a Graham Kelly corner to break the deadlock.
Stephen Kenny emptied his bench in a bid to salvage something but Dundalk – badly missing the influence of their injured captain Stephen O'Donnell – limped to the full-time whistle without ever looking like grabbing what would have been an undeserved equaliser.
BRAY WANDERERS – McGuinness; Cooney, Webster, Mitchell, Maloney; Scully, Zambra, Kelly, Cassidy, O'Neill (Hanlon 84); Akinade (Byrne 90).
DUNDALK – Cherrie; Gannon, Gartland, Boyle, Massey; Shields, Higgins (Hoban 70); Byrne (Mountney 79), Towell, Horgan (Meenan 58); McMillan.
REF – D McKeon (Dublin).