LOS ANGELES -- Alex Villanueva scored an upset win Monday in the race for Los Angeles County sheriff, making Jim McDonnell the first incumbent to lose the seat in more than a century. Villanueva, a retired sheriff's lieutenant, proclaimed victory last week. But McDonnell had declined to concede, saying he would wait for all the votes to be counted in the contest to lead the nation's largest sheriff's department.

He finally admitted defeat Monday after updated election results showed Villanueva leading by nearly 126,000 votes with only 100,000 ballots left to be counted, according to City News Service.

McDonnell promised an orderly transition of power in a statement released Monday, nearly three weeks after the Nov. 6 election.

Villanueva is expected to be sworn in next week to lead the department, which has been plagued by scandal in recent years. Former Sheriff Lee Baca was convicted in 2017 of obstructing an FBI investigation into corrupt and violent guards who took bribes to smuggle contraband into the jails he ran and savagely beat inmates.

Get Breaking News Delivered to Your Inbox

McDonnell highlighted his efforts to combat serious assaults by deputies in jails, the issue that led to Baca's resignation in 2014 amid the corruption investigation, reports the Los Angeles Times. But Villanueva campaigned to "clean house," arguing not enough reform was made under McDonnell, reports CBS Los Angeles. He had the backing of the Los Angeles Democratic Party and the Association of Los Angeles Deputy Sheriffs, the union representing rank-and-file deputies.

He also had the backing of an immigrant rights group after he vowed to kick U.S. Immigration and Customs Enforcement officials out of the county's massive jail system, reports the Los Angeles Times. Jurisdictions across the country have faced controversy when it comes to cooperation with ICE over inmates flagged for deportation. The Times reports that Villanueva would still honor ICE's request to detain inmates convicted of serious crimes, however, as the department does now.

Both McDonnell and Villanueva are veteran law enforcement officers, reports CBS Los Angeles. Villanueva spent three decades with the LASD before retiring earlier this year, while McDonnell was with the Los Angeles Police Department for 29 years — including as second-in-command to then-chief Bill Bratton — before going on to lead the Long Beach Police Department and then being elected sheriff in 2014.

McDonnell had the endorsement of at least four of the five county supervisors who control his budget and had the support of Los Angeles Mayor Eric Garcetti, former Los Angeles Police Chief Charlie Beck, and Los Angeles County District Attorney Jackie Lacey.

"The honor of serving as the LA County Sheriff is one like no other in law enforcement," McDonnell said in a statement. "The Sheriff will be immediately faced with a range of very complex issues that go to the heart of maintaining public safety and public trust."