French Junior Minister for the Digital Sector Mounir Mahjoubi (LUDOVIC MARIN/AFP/Getty)

French government minister Mounir Mahjoubi has come out as gay.

The politician, 33, serves as Secretary of State for the Digital Sector, and was a key member of President Emmanual Macron’s underdog political movement that swept the country’s elections in 2017.

Mahjoubi came out on the International Day Against Homophobia, Transphobia and Biphobia yesterday (May 17).

He wrote: “Homophobia is an ill that eats away at society, invades high schools, and poisons families and lost friends.

“Worse, it haunts the minds of gay people, and sometimes forces us to hide and lie to avoid hatred, to live.”

The message quietly referring to himself as a member of the gay community is the first time the En Marche politician has publicly spoken about his sexuality.

He was congratulated by other political figures and members of the LGBT community.

The former tech entrepreneur, who is of Moroccan descent, opened up about his decision to come out in an interview with French-language outlet franceinfo.

He said that he “did not think it was all that interesting” for most people, but made the decision “to help to fight against homophobia” and send a message to young people.

He added: “Yesterday was the International Day Against Homophobia. It was important to explain the consequences of homophobia in everyday life… and the consequences it had for me.

Mahjoubi said that while he wishes to live a private life, “If I could pass on the message [to younger people], emphasising it with my personal experience, I think I needed to do that.”

He added: “The fight against all hatreds, especially homophobia, is a conviction shared by all members of the government.”

The politician, who is married, said: “I think it’s important for gay people to have visibility, but no one should have to come out until they’re ready to do it.

“Everyone has their history, their culture, their family… we do not want to force anyone to [come out].”

President Macron also posted a message for IDAHOBIT, writing: “Across the world, lesbian, gay, bisexual and trans people are victims of discrimination and violence, and even sentenced to death.

“We all have the right to be ourselves. Denying that right and causing suffering is unacceptable and we condemn it as such.

Education minister Jean-Michel Blanquer added: “Homophobia is a scourge in schools and in society. It is the fruit of stupidity, intolerance and cowardice.

“We must fight it on a daily basis in the name of the values of the Republic and humanism. We will get there through the work of all educators.”

France legalised same-sex marriage in 2013.

Since taking office, Macron has vowed to make sure the country stands up for LGBT rights both at home and on the global stage.

Homosexuality is illegal in Morocco.