An Austrian army officer called Gregor went on holiday - and came back as a woman called Jasmin.
The 46-year-old captain took three months leave after complaining of stress, and had a sex change operation before returning to barracks in Gratkorn.
Other officers and soldiers were reportedly shocked when Jasmin, whose full name has not been revealed by the army, came back.
But senior army staff have decided Jasmin can keep her old job and will not be demoted.
Defence Ministry officials have also accepted the decision by Jasmin, who has two children, to have a sex change.
Ute Axmann, press spokesperson for the Austrian defence ministry, said: "We accept this very personal decision."
A soldier at the barracks told Austrian media: "Everybody has a weird feeling about it: a colleague leaving the building as a man and returning as a woman after his holiday is more than a bit strange. We will have to wait and see if this leads to problems."