Andres Iniesta has paid tribute to fellow Spaniard Fernando Alonso following the latter's decision to leave Formula One at the end of the year.

Two-time world champion Alonso confirmed his impending exit from F1 on Tuesday, with his 18th season in the series set to be his last.

Spain midfielder Iniesta, who made a significant move of his own earlier this year when leaving Barcelona for Japanese side Vissel Kobe, paid tribute to Alonso via Twitter on Thursday.

"You are a Spanish and worldwide sports legend," Iniesta wrote.

"Thank you so much for every times [sic] that you made us enjoy. An example of work, sacrifice, proffesionalism [sic] and dedication."

Alonso will continue to compete in the World Endurance Championship after the 2018 F1 season ends, but has yet to reveal which other opportunities he may choose to take up.