Adam Boyd encouraged the girl to perform sex acts on him and had intercourse with her at a house in Inverness and at a village in the Highlands.
The army veteran told police that he was sick and they should allow him to kill himself when he was confronted over the allegations.
The High Court in Edinburgh heard that Boyd tried to get a knife from the kitchen but police stopped him.
A judge told Boyd, of Moredun House, Craigour Green, Edinburgh, that he knew the age of the girl and that his course of conduct was criminal and abusive.
Lady Scott said: “The circumstances, I have concluded, require a prison sentence.”
She told Boyd that she would have jailed him for three and a half years for his crime, but for his guilty plea.
The judge said she accepted that Boyd had shown remorse and had mental health difficulties at the time.
Lady Scott pointed out that Boyd had experienced trauma during his Army career which included tours of duty in Afghanistan and Iraq.
Boyd (30) admitted engaging in sexual activity with the girl when she was aged 14 and 15 between July 2014 and November 2015.
Defence counsel Derick Nelson said: “He feels guilt, shame and remorse.”
He said the former soldier was suffering from post traumatic stress disorder and had been “exposed to the horrors of war in fairly devastating ways”.
Mr Nelson said Boyd was “in a terrible state mentally” when he committed the sexual offending.
The former security officer was placed on the sex offenders’ register.