Mayor Mike McGinn's campaign had held out hope that later ballots would trend in his favor. While the numbers showed some slight improvement for him Wednesday, he was still losing among those more recent ballots.

Murray said the victory is a sign of a city craving leaders who will bring people together to solve problems.

"We want Seattle to be an example of how government can function," he said.

A spokesman for McGinn said the mayor would hold a news conference Thursday morning.

The two candidates had largely campaigned with similar policy positions, but they offered contrasting styles of how to lead the Northwest's largest city. Murray's call for a more collaborative approach led him to build a broad range of endorsements and financial support.

Murray is a longtime state lawmaker who for years led efforts to legalize gay marriage in the state, which was approved by voters last year. He will become Seattle's first openly gay mayor.

Murray said there is significance in that milestone since there are limited numbers of openly gay elected officials. He said it is particularly significant for young gay and lesbian people who live in isolation.

In their campaign to court the left-leaning voters, the two mayoral candidates embraced ideas such as a $15 minimum wage, new taxes and legal marijuana. They each have lengthy backgrounds championing liberal causes in the Seattle area.

Before becoming mayor, McGinn was an activist with the environmental group Sierra Club, and he has continued to stake out a message of environmental stewardship. McGinn often rides his bike around Seattle, is pushing for pension fund money to be divested from coal companies, and is an advocate for expanded transit services.

Murray said McGinn's approach during his first term has alienated groups and political leaders in Olympia, making it harder for Seattle to win support for its priorities. McGinn had questioned Murray's effectiveness given that a Republican-dominated majority now controls the state Senate.

Combined, Murray and McGinn raised and spent more than $1 million, with Murray leading the money race by a few hundred thousand dollars