The mayor emphasized that Whent was not the subject of that investigation and revealed that the city has retained an independent investigator to review the police department's administrative probe into the case.
"We will hold anyone who has engaged in misconduct in this department fully accountable," Schaaf said.
In a statement circulated by the city administrator at 11:15 p.m. Thursday, Whent expressed pride in his two decades of service in the Oakland Police Department.
"When I took this job three years ago as interim chief, I vowed to help move the department forward and make Oakland safer by forging a stronger relationship with members of this diverse community," he said. "I am proud to have done that."
In her statement, Schaaf expressed gratitude to the chief, credited him with making the city safer, and said "he has done the critical work of driving principled, sustainable policing in Oakland."
John Burris, an Oakland civil rights attorney who represents plaintiffs in the "Riders" civil rights case against the department, told KQED's Ted Goldberg on Friday morning he felt Whent had done a good job as chief overall and that the resignation came as a complete surprise.
"The investigations that were taking place -- although we were not privy to all of them -- were significant and they raised real questions about what the chief knew and when did he know it," Burris said.
Ben Fairow, a former Oakland police captain who now serves as a deputy chief for the BART Police Department, will head the department in an interim capacity while the city searches for a new chief.
"I've been away for several years but I'm ready to hit the ground running," Fairow said Friday morning. "I can assure the momentum the police department has, when it comes to fighting crime and establishing those relationships with the community, is going to continue and improve."
In the hours before Thursday night's announcement, several Bay Area news outlets, led by the East Bay Express, reported that Whent would be fired or step down.
The sex scandal that apparently prompted Whent's departure came to light after the suicide of an Oakland officer, Brendan O'Brien, last September. O'Brien's death, in turn, followed the gunshot death of his wife in 2014 under circumstances a coroner's report described as suspicious.
U.S. District Court Judge Thelton Henderson, the judge overseeing a sweeping package of reforms in the Oakland Police Department arising from the Riders lawsuit, expressed dismay with the department's handling of the investigation earlier this year.
In a one-page order filed March 23, Henderson cited "irregularities and possible violations" of the settlement and said the case "raises most serious concerns that may well impact" the Police Department's "ability to demonstrate their commitment to accountability."
He directed Robert Warshaw, the man he appointed to monitor the OPD's compliance with the settlement, to oversee the investigation.
When the O'Brien angle to the sex case became public last month, Mayor Libby Schaaf called for an independent investigation by the Alameda County District Attorney's Office -- one that would exclude any of the DA's employees who were former Oakland cops.
Schaaf appeared at a press conference with Whent on May 13 and declared, "We as Oaklanders can expect to hold officers to the highest standards of conduct -- again, both while they wear a uniform and when they do not. And that is a standard that we intend to enforce in the city of Oakland."
So far, two officers have resigned as a result of the alleged sexual misconduct and two others remain on paid leave while the department's Internal Affairs Division investigates.
Before the case surfaced, Whent had received consistently high marks from Warshaw, the court-appointed monitor. Violent crime has been down since Whent took command. The chief won widespread credit for a change in the Police Department's approach to use of force when it went more than two years without recording a fatal shooting.
That period ended last June, and the OPD recorded a total of five fatal shootings over five months.
Whent was appointed interim chief in May 2013 when Chief Howard Jordan, under fire for the department's response to the Occupy Oakland demonstrations and other officer misconduct cases, retired with no notice. Whent received a permanent appointment a year later.
Resignation letter from Chief Whent to City Administrator
Ted Goldberg and Tiffany Camhi contributed to this report.