Bordeaux came through a five-goal thriller with St Etienne to cling on to fifth place in Ligue 1 and secure Europa League football.
Knowing that Rennes - in action against Dijon - tonight's opponents St Etienne and Toulouse could all unseat them were they to come unstuck, they looked in big trouble when they fell behind to Josua Guilavogui's 19th-minute opener.
A quickfire Cheick Diabate double quickly put them in front but, when Pierre-Emerick Aubameyang levelled, it meant that Bordeaux were susceptible again, especially with Rennes drubbing Toulouse.
But Yoan Gouffran had one last contribution to make for the visitors, winning it with 22 minutes left to make sure it is his side who will be playing overseas next season.
The possible outcomes meant a tense night was always on the cards as so it proved, with Bordeaux having and wasting the first chance, with Gouffran shooting at Stephane Ruffier.
St Etienne then went ahead with their first attack, with Aubameyang breaking free down the left after 18 minutes and crossing for Guilavogui who tucked a volley in.
The lead would only last four minutes, with Diabate beating Ruffier with a six-yard header from a Benoit Tremoulinas cross.
The same man was at it again with 28 minutes on the clock, again using his head to beat the goalkeeper after a good ball in from Landry N'Guemo.
St Etienne got back on the front foot after the break, with Bakary Sako going close, before the home side levelled in the 48th minute, with Loic Perrin playing in Aubameyang who did the rest with a lobbed header.
That only served to bring Bordeaux's task into even greater focus, and Diabate nearly made it a hat-trick with a low drive that Dufner kept out, before the third and decisive goal did arrive when the double-scorer played in Gouffran who did the rest.
The onus was now on St Etienne to attack and that they did, with Sako denied by Cedric Carrasso, but they had could not find a way through the visitors focused rearguard and were left to watch on as Bordeaux celebrated at the full-time whistle.