Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

TEL AVIV, Israel — The young Israeli lieutenant harbored a huge secret for years — she was he.

The moment of truth came when a group of cadets asked why the officer they knew as a female was wearing a man's uniform.

“I [came] to a conclusion that I cannot be an officer and a commander when I'm hiding this major secret," the 22-year-old told NBC News. "If I expect my soldiers to be honest with me I have to do the same with them. I told them I see myself as a man for all my entire life."

As Israel's first transgender military officer, the lieutenant requested that NBC News identify him as "Shachar," which means Dawn in Hebrew. Shachar said he did not want to garner undue attention while serving.

"Shachar" pictured as a child after asking his parents to shave his head. Dave Copeland / NBC News

Shachar, who was born in a kibbutz in southern Israel, knew from a young age that he did not want to be a girl.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

According to his parents, at the age of two he asked to have his hair shaved off. When he was four, he told them he no longer wanted to wear dresses.

From that moment on he looked like a boy, but did not know how to explain his feelings. It wasn't until Shachar was 16 that he learned the term "transgender" and the missing piece of the puzzle fell into place.

“In a period of three months I told my parents and closest friends and it was a great moment of feeling free," he told NBC News in an interview at Tel Aviv's Kirya military base.

While Shachar knew from childhood that he identified as a boy, he also knew that his future was in the military, where his mother and father both had been officers.

Israel's armed forces are among the most accepting when it comes to issues of gender identity, according to Oded Frid, the former CEO of the Israeli National LGBT Task Force rights group.

The army cancelled its equivalent of the U.S. "don't ask, don't tell" policy and began drafting openly gay recruits in the late 1990s, Frid said. In America, the policy wasn't suspended until 2011.

"Compared to other armies in the world Israel’s army is more advanced in its approach and official policy towards the LGBT community but ... in a lot of other areas in the country we are not advanced," Frid said. "Nowhere in the Israeli law is there any recognition for LGBTs in any way and in many areas even discriminates [against] them."

The first openly transgender person enlisted in the Israeli army in 2000. Today there are dozens, according to Lt. Col. Limor Shabtai, the military's gender adviser.

Shachar knew from childhood that he did not want to be a girl. Dave Copeland / NBC News

According to Israeli law, a citizen can initiate the gender-reassignment process at the age of 18, which coincides with the mandatory draft age.

“The army’s policy is that being transgender is not an obstacle for being enlisted," Shabtai said. "I make sure to talk to every commander where a transgender serves and give them guidelines on how to deal with this situation."

Joining the army was an obvious choice for Shachar, but handling the concept of being a woman was not. However he joined the military, and was drafted as a female.

“My biggest and hardest moment going into the army was standing on line to receive my uniform," he said. "I was listed as female so they gave me the women's uniform. I took the biggest size you can get so it would not look feminine in any way."

To solve the issue of what to wear, Shachar's commanding officer allowed him to wear a unisex uniform. They also let him shower at different times in the women's barracks.

Shabtai says she regularly receives questions from young recruits about coming out.

Shachar, who has started receiving medical treatment, said his colleagues have been supportive.

"My closest commanders wanted to help me however they could and this is very special," he said. "It made me feel that they really wanted me to succeed here in the army and this is what I want young soldiers now to feel."