Troy Bayliss has completed his championship winning day in perfect style with a tremendously hard fought victory in the second World Superbike race of the day at Magny-Cours.

Heading into the race safe in the knowledge that he can conclude his career with a third and final world title, Bayliss was keen to end his day on a high with what would be a 50th victory in his 150th race.

However, he still had to contend with Noriyuki Haga, who had dominated the first race for his third win in a row. Things looked good for the Japanese rider from the off, with Bayliss getting lead into the first corner, just as he did in race one, only for Haga to snatch it off him soon afterwards.

Haga and Bayliss proceeded to try and pull away from the masses behind, initially led by Fonsi Nieto, only for him to be passed by Carlos Checa and Troy Corser on lap four. Corser would soon get past Checa for third too as he made a determined bid to challenge up at the front from 12th on the grid.

Indeed, it was turning out to be a spirited ride by Corser, who didn't take too long to catch Haga and Bayliss up at the front, the pair staying close together despite Haga's best attempts to break away.

It was all change on lap eight though as it became apparent that light rain was falling on certain parts of the circuit. Although it was never enough for the race to be put in doubt, it did do plenty to spook Haga, who lost the lead to Bayliss on the run up to Imola, before Corser followed through into second place a lap later.

However, with neither heavier rain nor a red flag following over the next couple of laps, Haga got his confidence back to pass Corser on lap ten before overtaking Bayliss for the lead on the run down to Lycee a lap later. Corser attempted a similar move soon afterwards, only to run wide on the exit and lose too much ground for him to make up again.

As such, attention turned to the dispute for victory between legendary sparring partners Haga and Bayliss. Although Bayliss dropped back ever so slightly as the race entered its final stages, he simply reeled in Haga with just a handful of laps remaining.

Bayliss made his first move at Chateaux d'Eau four laps from home, but after running just ever so slightly wide, Haga simply dived back beneath him to re-take the lead. The same occurred a few corners later when Haga ran wide at Estoril, allowing Bayliss through, only for the two to swap places again when the Ducati wriggled out of the bend.

Bayliss' decisive move finally came on the penultimate lap, albeit at a somewhat surprising place. Seemingly getting a better run out of the 180 hairpin, Bayliss tailed Haga up to the high-speed Imola chicane and dived through as they dipped into the apex. Getting the crowd up to their feet, Haga attempted to respond but Bayliss had him covered and was simply able to enjoy the final lap of his ninth race win this year.

Also bringing his victory tally up to an unprecedented 50 victories, Bayliss was thrilled to prevail in what could be his final direct head-to-head with Haga before he retires and hands his bike over to his rival.

Corser kept a watching brief to finish third, although the weekend has seen him lose his provisional runners-up spot to team-mate Haga now.

Elsewhere, having looked as though he could be a factor mid-way through the race, Checa faded again, even if he was nonetheless still able to hold onto fourth place.

Ruben Xaus recovered from a dismal first race to record his best finish since victory at Misano back in June, the Spaniard resisting the attentions of Sterilgarda team-mate Max Biaggi to the finish line. The Italian had spent much of the race in the chasing pack before breaking free in the latter stages, although he wasn't quite able to do anything about Xaus.

Yukio Kagayama got the better of his Suzuki team-mates to finish a solid seventh, the Japanese rider taking advantage as race one podium sitter Fonsi Nieto and Max Neukirchner perplexingly slid down the order. The trio would eventually finish seventh, eighth and ninth.

After the disappointment of retiring from the first race, Roberto Rolfo was able to put his good grid position to better use in race two, the Italian battling hard with the front runners early on before eventually finishing tenth.

Lorenzo Lanzi was a quiet 11th, ahead of Gregorio Lavilla and Jakub Smrz, the privateer riders having been able to get the better of Michel Fabrizio, who ran as high as seventh early on before dropping back down the field at an alarming rate. His retirement in the first race means he scores just two points this weekend.

As was the case in the first race, Chris Walker grabbed the 15th and final point on the Paul Bird Motorsport Honda.