Rossi, who retired from MotoGP at the end of 2021, spent this year competing for WRT in the Fanatec GT World Challenge, at the wheel of an Audi.

WRT is switching to BMW for 2023, with Rossi signing to race an M4 in both the Fanatec GT World Challenge and Bathurst 12 Hour.

But the new agreement, directly with BMW, means the 43-year-old Italian will now also be available for further unspecified ‘race and test appearances in BMW M Motorsport racing cars’.

Further details will be announced at a later date.

Yamaha are lost at sea! | MotoGP 2022 Christmas special

"I am very proud to become an official BMW M works driver and it is a great opportunity,” said Rossi.

“Last year I started racing seriously in cars and I finished my first season with the WRT team with whom I got on very well and I am very happy that the WRT team chose BMW M Motorsport as a new partner.

“I have already had a chance to test the BMW M4 GT3 twice and the feeling with the car is very good. I think we could be competitive next season.

“Also, BMW M Motorsport has given me the opportunity to race with two very strong drivers next year, Maxime Martin and Augusto Farfus.

“I still have a lot to learn and improve, but I hope to be up to the task and fast enough to fight during the race weekends.”

BMW: Rossi ‘a living legend’

Andreas Roos, Head of BMW M Motorsport, added: “Valentino Rossi needs no introduction. As one of the most successful motorcycle riders of all time, he has made history. His successes on the racetrack and his personality have quite rightly made him a living legend.

“But Valentino has proved that he is also an excellent racer on four wheels. He has shown that car racing has become his second motorsport home, and he brings all his passion, skills and commitment to this new chapter of his career.

“It’s fantastic that Valentino will be joining our BMW M Motorsport family as a new works driver next year. We’re really looking forward to working together – welcome aboard Vale!”

Rossi is the 21st member of the BMW M works driver squad.