Connacht were already out of contention but this superb win in the south of France last night could transform their season.
Eric Elwood's men brought a nine-match losing run to an end with a superb performance at Stade Jean Dauger. Connacht led 22-16 at half-time, having hit the front in the first minute with an Ian Keatley penalty.
Connacht were awarded a penalty try after 16 minutes when Fionn Carr was taken out as he chased a kick from Brian Tuohy.
Bayonne, needing to win to make their trip to Harlequins next weekend a clash to determine the pool winners, hit back with a third penalty from Julien Audy, but Keatley landed two more penalties to make it 22-9.
Bayonne hit back just before the break with centre Thibault Lacroix bursting through the tackles to touch down. The hosts came out with all guns blazing after the restart and it looked like it would be a long night for Connacht when Marc Baget broke through some weak defending for a 43rd-minute try.
Audy, however, missed the relatively easy conversion to level and after weathering the storm, Connacht extended their lead when Keatley took his haul to 20 points with another penalty to leave it 25-21 going into the final quarter.
Connacht finished on the offensive and were rewarded when Sean Cronin put Tuohy in for the decisive score, before Carr sealed the victory with a breakaway try.
Bayonne finished with 14 men when replacement Jean Jo Marmouyet was red-carded.
Scorers -- Bayonne: Fauque, Lacroix tries; Audy 3 pens, con. Connacht: penalty try, Tuohy, Carr tries; Keatley 6 pens, con.
Bayonne: P Elhorga; G Ziegler, T Lacroix, S Fauque, J Pietersen; B Boyet, J Audy; T Lea'aetoa (P Lafond 59), A Heguy, D Avril (W Desmaison 63); R Linde, C Treloar (R Filipo 59); G Bernad, D Haare (J Marmouyet 59), M Baget (F Carillo 67).
Connacht: F Carr; S Monahan (M Nikora 70), E Griffin (K Matthews 52), N Ta'auso, B Tuohy; I Keatley, F Murphy; B Wilkinson (R Loughney 70), S Cronin, J Hagan (R Ah You 63); B Upton (M Swift 50), M McCarthy (A Flavin 68); A Browne, J O'Connor (S Conneely 29), M McComish.
Referee: P Allan (Sco).
Sunday Indo Sport