This story is part of our 2017 elections coverage.

Several mayors were defeated in their re-election bids earlier this year, but incumbency proved to be a powerful advantage on Tuesday as most big-city mayors who were on the ballot won new terms.

That includes Bill de Blasio of New York who became the first Democrat re-elected to that office since 1985.

Big cities have been a rare preserve of Democratic strength at a time when the GOP continues to dominate state politics and the federal government. But Republican mayors in several midsized cities -- Atlantic City, N.J.; Annapolis, Md.; Fayetteville, N.C.; and Manchester, N.H. -- were defeated by Democrats on Tuesday.

Also on Tuesday, Jenny Durkan won the mayor's race in Seattle. The former prosecutor was the Democratic Party's establishment choice against activist Cary Moon. Durkan is the first woman elected Seattle mayor since the 1920s. She joins Salt Lake City's Jackie Biskupski as the nation's only current big-city mayors who are openly lesbian.

In Charlotte, N.C., Mayor Pro Tem Vi Lyles easily beat Republican City Councilor Kenny Smith, despite being badly outspent. Lyles had unseated Mayor Jennifer Roberts in the Democratic primary.

“You've proven that a woman whose father didn’t graduate from high school can become this city’s first female African-American mayor," Lyles told supporters on Tuesday night.

Along with Roberts, the sitting mayors of Birmingham, Ala.; Jackson, Miss.; and San Antonio all lost their jobs earlier this year.

But the November election proved to be more positive for most big-city mayors.

Cincinnati Mayor John Cranley lost the May primary against City Councilmember Yvette Simpson by a double-digit margin. But he took that loss as a wake-up call and improved his campaign's ground game -- aided by a four-to-one fundraising advantage. Cranley took 55 percent of the vote on Tuesday.

"This comeback city has made me the comeback kid," Cranley told supporters on election night.

In St. Petersburg, Fla., Mayor Rick Kriseman won re-election over former Mayor Rick Baker, taking 51.6 percent of the vote to Baker's 48.4 percent.

Cleveland Mayor Frank Jackson and Buffalo, N.Y., Mayor Byron Brown each won their fourth terms. William Peduto of Pittsburgh was unopposed Tuesday, after winning the Democratic primary in the spring.

In Boston, Mayor Marty Walsh took 65 percent of the vote against City Councilor Tito Jackson. No Boston mayor has lost a re-election campaign since 1949. Like Kriseman and a number of other Democrats running for mayor, Walsh took some shots along the way at President Trump. He has fought with the administration on policies regarding immigrants and transgender individuals, among other issues.

"We’re going to keep tackling all the national challenges that limit opportunity in our city," Walsh said Tuesday.

Even mayors seeking re-election under ethical clouds won.

Jersey City Mayor Steve Fulop convinced voters that a contracting scandal had been politically motivated, even though his top aides were caught on tape attempting to convince the city's business administrator to give a contract to an energy consultant.

Allentown, Pa., Mayor Ed Pawlowski won, despite having been indicted on 54 counts of extortion, bribery and fraud. His re-election margin was down, but some voters said they believe he had been set up. Pawlowski's case could go to trial as early as January.

And Karen Weaver, the mayor of Flint, Mich., turned back a recall attempt. Although the recall was launched in response to a garbage contract, attention turned during the campaign to the city's water crisis. Nonetheless, Weaver won easily.

"It's time to get back to work," she declared.

Not every race was decided on Tuesday night.

Minneapolis Mayor Betsy Hodges was trailing in her re-election bid Tuesday, finishing third in the first round of voting behind City Councilmember Jacob Frey and Tom Hoch, who's headed a number of civic agencies and nonprofits. The city uses ranked-choice voting, so the final outcome was unclear early Wednesday morning.

Two members of the Atlanta city council will make next month's runoff for mayor. Keisha Lance Bottoms, who has the support of outgoing Mayor Kasim Reed, finished ahead of Mary Norwood, who had been the early favorite in the race.

In addition to Atlanta, two other sizable cities will have mayoral voting in the days to come. On Nov. 14, Democratic state Auditor Tim Keller and Republican City Councilor Dan Lewis will square off in Albuquerque, N.M. On Nov. 18, New Orleans voters will decide between City Councilwoman LaToya Cantrell and Municipal Court Judge Desiree Charbonnet.

This story is part of our 2017 elections coverage.