Richard Duffy was trapped by DNA recovered from the victim’s cheek where he had given her smothering kisses.
His fingerprints were also discovered at the house in Hoghton, near Preston, where he managed to sneak in one night last summer.
The thirty-one-year-old woman was shocked and horrified when the truth dawned about what was taking place at the house in the middle of the night.
Duffy (32), of The Crossings, Hoghton, had worked as a PE teacher at Primet High School, Colne. He had pleaded guilty to a sexual assault charge and will now be on the sex offenders register for life.
His victim was at Preston Crown Court as sentencing took place.
Duffy was a complete stranger to her.
Mr Francis McEntee (prosecuting) submitted that the defendant’s behaviour as he quietly left the house showed a degree of stealth.
The woman had been asleep as Duffy began giving smothering kisses to the left side of her face and her neck. The sex assault followed.
He said: “There was a dawning realisation that it wasn’t her partner. She opened her eyes and was shocked and horrified.
“She realised her partner was in bed beside her”.
The touching had lasted for 20 to 30 seconds.
In a victim personal statement, the woman spoke of how her life had been affected by what took place.
Mr Ian Whitehurst (defending) said Duffy’s actions beggared belief.
He said: “This was a very serious drunken escapade, where he saw an opportunity and took it.
“He has a strong sense of remorse and a desire to apologise. He has brought shame and embarrassment on his family.
“The defendant himself still has difficulties coming to terms with his actions. He is wracked by guilt and shame for what he did”.
Mr Whitehurst said Duffy had been devoted to his career. What had taken place would affect his life for the rest of his days.
Judge Anthony Hammond told Duffy he had difficulty in understanding why he should go into that house.
He added: “It is almost as serious as an offence of rape. Quite frankly, if it had been rape it would be a double figures sentence”.
After sentence was passed, Detective Inspector Paul Rudd, of Chorley CID, said: “I am pleased with the sentenced handed down by the judge today. This was a particularly nasty offence against a woman who felt she should have been safe in her own home.
“Duffy gave no comment to police during his interview and has still not explained his actions on the night in question, but I can only hope that today’s result will bring some comfort to the victim in this case and allow her to begin to move forward.
“Thankfully, these types of offences are rare and are vigorously investigated by Lancashire Constabulary. It is clear that Duffy poses a risk to women and I am pleased that he has been removed from the streets and will now be spending time behind bars.”