A top member of the Israel Defense Forces (IDF) high command has openly revealed he is gay. It was the first time in IDF history that a high ranking officer revealed his homosexuality, according to the Jerusalem Post.

Colonel Sharon Afek, who is currently the IDF Military Advocate General, made the announcement during an interview with the Israel Bar Association's official magazine on Wednesday (10 May).

"I never felt discriminatory or preferred treatment due to my sexual orientation," Afek, 46, said.

"When I was a young officer, times were different and I worried that the issue would be used against me and that I might really hit the glass ceiling. But happily, the issue did not make waves," he continued.

The top officer added it was important for him to send a message of support to LGBT ( lesbian, gay, bisexual, and transgender) youths who are about to be drafted into the army.

"It is important for them to know that there is no glass ceiling that will hold them up in the IDF. Their success depends on them and only them. It is possible to rise to the top of pyramid," he said.

"The IDF is the people's army and it encourages all who want to contribute and grow. I will be pleased if many more will walk in my footsteps."

Afek became the Israeli army's top attorney in 2015. Before his appointment, he had spent nearly 25 years in the IDF, the Times of Israel said.

Israel is one of the most gay-friendly countries in the Middle East and is regarded as tolerant of both gay men and women. Tel Aviv, a city on Israel's Mediterranean coast, was named the best gay city of 2011.

However, the Association for Civil Rights in Israel said LGBT people still face some forms of discrimination by government authorities and in the private sector in the country.

In February, a ministerial committee on legislation stirred criticism after turning down three bills concerning the status and protection of the LGBT community in the country, a day before the Knesset – the legislative branch of the government – marked LGBT Rights Day, local newspaper Haaretz reported.