Man sexually attacked victim after she left nightclub in Glenrothes
Bikramjit Singh, 22, was jailed after a jury found him guilty of assault with intent to rape.
A sex attacker has been jailed for three years for an assault on a woman in Glenrothes.
Bikramjit Singh, 22, was sentenced on Tuesday after a jury found him guilty of assault with intent to rape.
Sentencing him at the High Court in Edinburgh, judge Edward Bowen QC told him: "It could have been much worse had it not been for the courage and spirited behaviour of the young woman involved."
Defence advocate Niall McCluskey said Bikramjit Singh continued to deny the offence.
A jury heard how on April 15, in Warout Road and Pinkerton Road, Glenrothes, Fife, he walked beside his victim, after they left a nightclub together.
He repeatedly grabbed hold of her and tried to talk to her, asking her to marry him.
She ignored his sexual remarks and suggestions that they should go to nearby woods but Bikramjit Singh seized her from behind, clapped his hand over her mouth and dragged her across a road.
When she fell to the ground he tried to pull off her clothes but her shouts scared him off and ended the attack.
The court heard that Bikramjit Singh had been living in Glenrothes. He came to the United Kingdom from India on a student visa in July 2011 but gave up his college course.
Mr McCluskey suggested he would face deportation after the end of his sentence.