Last month, the Hungarian government passed a new law to try and limit discussion of homosexuality and transgender issues in schools and Prime Minister Viktor Orban plans to hold a referendum on the legislation.

Speaking in an Instagram post addressing his 23.2 million followers on the eve of this weekend’s race in Budapest, Hamilton attacked the discriminatory legislation and urged the people of Hungary to vote against it.

“To all in this beautiful country Hungary,” Hamilton wrote. “Ahead of the grand prix this weekend, I want to share my support for those affected by the governments’ anti-LGBTQ+ law.

“It is unacceptable, cowardly and misguiding for those in power suggest such a law. Everyone deserves to have the freedom to be themselves, no matter who they love or how they identify.

“I urge the people of Hungary to vote in the upcoming referendum to protect the rights of the LGBTQ+ community, they need our support more than ever. Please show love for those around you because love will always win. Sending you positivity.”

Hamilton is the latest F1 driver to offer support for the LGBT community after Aston Martin’s Sebastian Vettel hit out at football’s governing body, UEFA, in June.

Vettel’s criticism came after UEFA refused to allow Munich’s stadium to be lit in rainbow colours for Germany’s Euro 2020 match against Hungary.

"I think to excuse it that it is a political message is the wrong path," the four-time world champion said at the Styrian Grand Prix.

"I think it is definitely not harming anybody and I think it is a great message that they would have loved to send out and were not allowed.

"Some institutions need to rethink their approach on banning this type of messages."