OLYMPIA, Wash. (AP) — Washington state’s most expensive election year in history neared its grand finale Tuesday, with voters deciding who to choose in one of the country’s most competitive governor’s races and whether to legalize marijuana and gay marriage — two initiatives that have been backed by big money and names.

The gubernatorial contest has drawn national attention from both parties, with Republicans seeking to win the leadership post for the first time in 32 years. The race remained too close to call, with one recent poll showing Republican Attorney General Rob McKenna and former Democratic U.S. Rep. Jay Inslee in a tie.

The breadth of contentious issues and races on Washington’s ballot has led to a flood of cash totaling some $157 million — about 20 percent more than the 2008 elections. That includes some $40 million spent on the governor’s race.

The effort to legalize gay marriage has drawn big money, including a $2.5 million donation from Amazon.com CEO Jeff Bezos and his wife, and six-figure donations from the likes of Bill and Melinda Gates, and from New York Mayor Michael Bloomberg. And Bill Gates and fellow Microsoft co-founder Paul Allen, who both live in the Seattle area, have combined to contribute some $4.5 million to an effort seeking to develop charter schools in the state.

An initiative to legalize marijuana also has drawn high-profile support, with a $250,000 from travel guru Rick Steves and more than $1.5 million from Progressive Insurance chairman Peter Lewis.

In the governor’s race, McKenna was seeking to become the first Republican to win the seat since John Spellman in 1980. He has cast himself as a moderate dedicated to increasing state funding for education.

Inslee has focused his campaign on a jobs plan that includes focusing investments on various industries such as clean energy. Both candidates have vowed to oppose new taxes, even though they will face a budget challenge as soon as they take office in January.

McKenna has positioned himself to compete in the race even though his party’s presidential nominee, Mitt Romney, is expected to lose the state to President Barack Obama by a wide margin.

Most of the country will know who won major races Tuesday night, but there’s a decent chance Washington residents won’t learn who ultimately prevailed in close races like the gubernatorial contest for days. That’s because mail-in ballots in the state only have to be sent by Nov. 6. Hundreds of thousands of ballots will remain to be counted after Tuesday.

In the gay marriage referendum, voters will decide whether to uphold a law approved by the Legislature and Gov. Chris Gregoire earlier this year. Washington is one of three states — Maryland and Maine are the others — in which voters are deciding whether to legalize same-sex marriage. In Minnesota, voters will decide whether to add a gay marriage ban to the state constitution.

Washington also is one of three states, along with Oregon and Colorado, in which voters are considering whether to approve marijuana for recreational use. The measure would set up a system of licensed marijuana growers, processors and retail stores — and supporters have been touting the potential tax benefits of placing the industry under state control.

Opponents have varied concerns, including fears from law enforcement and public health officials that the law will lead to increased abuse. Others noted that marijuana is still illegal under federal law, setting up a potential legal battle. Critics also say blood-test limits could affect those who already use marijuana for medical reasons, which is legal under state law.

Washington voters previously rejected the idea of charter schools, but supporters are making another run at the issue this year with substantial financial backing. Supporters say the proposal would open as many as 40 of the independent schools over five years, providing more flexibility in how to teach kids. Opponents say charters have a mixed track record in other states.

This year’s election also will determine a range of other matters, including a new state auditor, a new secretary of state and which party will have control of the state Senate. Federal races include the state’s U.S. Senate race, in which Sen. Maria Cantwell is widely expected to win re-election.

The most competitive federal race in the state is the 1st District House race between Democrat Suzan DelBene and Republican John Koster. That district, formed during the redistricting process, was designed to be balanced so that both parties could compete regularly for the seat.