The case was heard at Letterkenny Circuit Court.
The teacher, who was in his 20s, was taking part in a Strictly Come Dancing event at the school.
He received a message from the young girl and they began an online friendship.
However, some time later, the teacher, who cannot be named for legal reasons, sent the girl a picture of his erect penis.
They then arranged to meet on two occasions between February and April of 2012.
The first time they met she was very drunk, but he was sober and they met at her grandmother’s vacant home in East Donegal.
On that occasion, he had oral and full sex with the girl, who was a virgin at the time.
The following day he contacted the girl and told her what had happened was a mistake and should not happen again.
Then, on April 8, 2012, she had been drinking heavily at her family home and sent the man a text at 10pm.
He said he had been at a rugby match and became aroused when she contacted him.
They arranged to meet again and he asked her to bring a condom as he had not got one with him.
Again, full sex took place and she said he was much rougher than the first time.
Barrister for the man, Martin Giblin, said he had become completely ostracised from his community.
Before this he was an accomplished sportsman who enjoyed boxing and rugby.
He said he had also apologised to the girl.
The man, who pleaded guilty to the defilement of a child on two occasions, sat at the back of the courtroom wringing his hands and weeping throughout the case.
He had no previous convictions and came from a hard-working and decent family who were very upset by what had happened.
The man has also had to move out of his local area.
Judge Matthew Deery said the man has been co-operative and apologetic.
“The position is she was vulnerable and the offences are obviously serious,” he said.
He added that it was clear that he took advantage of her.
He sentenced the man to two years for each charge to run concurrently, but suspended the last six months of each sentence meaning the man will serve 18 months in prison.