An, 54, was indicted in April on charges of forcing his former secretary, Kim Ji-eun, to have sex with him four times and molesting her multiple times between the middle of last year and early this year in Seoul and while on overseas business trips.
He has been charged with sexual intercourse and harassment by abuse of occupational authority. An's charges are punishable by up to five years in prison or a 15 million won (US$13,300) fine.
Prosecutors said An's acts amount to "a felony in which the former governor abused his power to take advantage of the vulnerability of his secretary who devoted herself to working for his office."
They also demanded he be ordered to take therapy classes and be registered on the sex offenders list.
The court will hand down its verdict on Aug. 14.
The high-profile scandal broke in early March when Kim made the revelation in a cable TV news interview. An resigned days after the interview aired and he was expelled from the ruling Democratic Party.
The accusation has shocked the public as An, a prominent liberal politician, had been considered a potential presidential candidate. He ran for the primary before last year's presidential election and lost to his then rival Moon Jae-in.
An has apologized to the public over the scandal but has not admitted to the charges.
In Friday's trial, he insisted the relationship with Kim was consensual.
"I never used my position to wield power (over Kim)," he told the court. "I won't evade social and moral responsiblity, and yet I do ask the court to make a fair legal judgment."
His lawyer said Kim's testimonies lack verification and credibility, arguing they are not enough to substantiate the charges beyond a reasonable doubt.
Earlier in the courtroom, Kim took the stand for her last testimony. She stressed the intercourse was never desired but based on coercion by a person in a position of authority.
Sobbing and choking in distress, she talked of the extreme pressure under which she has lived as a victim and accuser for the past four months.
"I feel like I'm as dead as the food in a can," she said. "I had to keep remembering the eight months of nightmare to repeatedly testify in court. I'm distraught at how his witnesses told the court such deliberate lies."
Kim thought about ending her life and was fraught with self-hatred and regret, but her faith in truth has made her endure and not give up, she added.
The trial has attracted heated media attention since it began in June. Kim's legal counsel and feminist groups advocating for her have accused the court of not protecting her rights and local media of sensationalizing the trial.
"They also demanded he be ordered to take therapy classes and be registered on the sex offenders list" Yes to all of this (especially the last part)