The man, who cannot be named for legal reasons, pleaded guilty to two charges relating to a 14-year-old girl, who was described in court as vulnerable.
Letterkenny Circuit Court heard that they first met in school, where the man, who was 23 at the time, worked as as a teaching assistant.
The relationship then developed through Facebook and later through text messaging.
The court heard details of how the man had sexual intercourse on two occasions with the teenage girl.
The incidents occurred in February and April 2012.
The girl told gardai that she sneaked out of her home and met the accused in her grandmother’s house, which was unoccupied, where they had sex.
She also said she was very drunk, but he was sober.
In her statement to Gardai the girl said she was a virgin at the time. A medical examination later confirmed this.
On the second occasion when they met, again in the girls unoccupied grannies house, she said they had been both drinking, but the man was very drunk.
Gardai then became involved when the girl confined in a social worker about the incidents and ongoing family issues.
The man made full admissions upon his arrest and admitted that he knew the girl was 'only 14 or 15'. He admitted that he had done wrong.
The court heard that the man said he was going through a difficult time during this period and was consuming a lot of alcohol and suffering from depression. The court also heard that the accused had tried to take his own life on two occasions.
Mr Justice Matthew Deery noted that the accused was a young man with a ‘serious drink problem’ who had shown that he was very remorseful.
But he also stressed that the injured party was ‘very vulnerable’ at the time in question.
Mr Justice Deery sentenced the accused to two years for each charge, but suspended the last six months of each sentence, culminating in an 18-month sentence