Hannah was found strangled two days after she went missing
The man accused of murdering 17-year-old Hannah Foster has told a jury he was kidnapped, bound and blindfolded and forced to have sex with her.
Maninder Pal Singh Kohli, 41, who denies murder, claimed he was bundled into a car by three men on the night she disappeared in Southampton in 2003.
He said he was taken to a van and forced to have sexual intercourse with a woman, whom he believes was Hannah.
He told Winchester Crown Court it was "revenge" by a colleague over a debt.
Mr Kohli told jurors on Thursday he believed he was the victim of a conspiracy to frame him.
Hannah disappeared on 14 March 2003 while walking home in Southampton after a night out with a friend. Her body was found two days later.
Mr Kohli denies rape, kidnap, false imprisonment and murder.
He told jurors he had been having an affair with the wife of a work colleague, James Dennis.
Mr Kohli said he had repeatedly borrowed money from Mr Dennis and threatened to make the affair public when Mr Dennis asked for the money to be returned.
The jury has previously heard it amounted to about £16,000.
He told jurors that the day before Hannah disappeared, on 13 March 2003, Mr Dennis's brother, Jonathan, demanded Mr Kohli pay the money back.
Mr Kohli said that the next day, when Hannah vanished, he went for a meal after work with his family before driving to a pub where he continued drinking.
When he left at closing time he was grabbed near his van by two men who told him to get into the back of a dark-coloured car, he told the court.
One knelt on Mr Kohli's back and tied up his hands, a second sat on his legs while a third man drove the car, Mr Kohli said.
Mr Kohli said the men asked if he owed anyone money, and he said he would pay back Mr Dennis the following week, when the sale of his flat was completed.
After a short while driving, he was put in the passenger seat of a van. He then realised there was a "girl" in the vehicle, he told jurors, before he was punched.
Mr Kohli described how his trousers were pulled down and he was forced to have sexual intercourse with the girl, in the van.
He said he now believed she was Hannah Foster because police had found his DNA on her dead body.
He said he was told by the men that if he went to the police, the girl would report being forced to have sex.
He said he had left his regular van with Mr Dennis earlier in the day, and when he picked up the keys the next day, the van was still warm.
The case continues.