FORT LAUDERDALE, Fla. (AP) — Republicans scored key victories in Florida as Ron DeSantis won the governor race. The GOP also won two of three Cabinet races and led in the third. The outcome of the Senate race between Gov. Rick Scott and incumbent U.S. Sen. Bill Nelson remained so close Wednesday that it appeared to be headed for a mandatory recount.

Democrats, meanwhile, flipped two Republican seats in Congress while losing none they currently hold, helping their party's push to reclaim a majority in the House.

Voters also passed 11 of 12 proposed amendments to the state constitution. They restored the voting rights of more than 1.5 million felons who have served their sentences, banned greyhound racing starting in 2021, banned offshore oil drilling and banned vaping in most workplaces.

GOVERNOR

DeSantis defeated Democratic Tallahassee Mayor Andrew Gillum in one of the nation's most-watched governor races.

The former congressman had trailed in almost every poll leading up to Election Day, but he parlayed President Donald Trump's strong endorsements in the Republican primary and general election to pull off an upset.

Gillum would have been the first Democrat elected to the office since 1994, and the state's first-ever African-American governor.

DeSantis began as a relative unknown but built his name recognition with more than 100 appearances on Fox News, then won the primary over Agriculture Commissioner Adam Putnam by 20 points. He later accused Gillum of corruption and being a failed mayor.

Gillum shocked political observers by winning a crowded Democratic primary. He rarely mentioned DeSantis while promising to expand health care, protect the environment and raise corporate taxes to boost education spending. Former President Barack Obama and Vermont Sen. Bernie Sanders campaigned for him in the final week before the election.

U.S. SENATE

The bruising and expensive U.S. Senate race between Scott and Nelson is too close to call and appears headed to a mandatory recount.

With all precincts reporting early Wednesday, Scott held a lead of 38,717 votes out of more than 8 million cast — a margin of less than one half of 1 percent. Under state law in Florida, a recount is mandatory if the winning candidate's margin is less than 0.5 percentage points.

Scott had declared victory over the three-term senator late Tuesday before all precinct results were in, but Nelson did not concede, and his campaign said he would make no statement until later Wednesday. The Associated Press had not called the race.

Scott had been trailing in most polls leading up to Election Day. The wealthy former hospital executive, who entered politics as part of the 2010 tea party movement, poured $60 million of his own money into the race.

Nelson was a congressman from 1979 to 1991, then served in state government before his Senate election in 2000.

It's was a largely negative campaign, with Scott depicting Nelson as a confused, empty-suit politician who has achieved little in his time in Washington. Nelson has criticized Scott as an untrustworthy Trump supporter who used the governor's office to increase his wealth. His supporters also hit Scott for the state's environmental problems, calling him "Red Tide Rick" for the deadly algae that has killed millions of fish off Florida's coasts.

ATTORNEY GENERAL

Republican Ashley Moody defeated Democratic state Rep. Sean Shaw, keeping the state's top law enforcement position in Republican hands.

Moody is a former judge and federal prosecutor from the Tampa area who has criticized Shaw's lack of courtroom experience. Shaw would have been Florida's first black attorney general. He is the son of the late state Supreme Court Justice Leander Shaw. He campaigned as a consumer advocate and called for new gun restrictions.

Moody will replace Pam Bondi, who could not seek re-election because of term limits. Democrats last won the attorney general's race in 1998.

CHIEF FINANCIAL OFFICER

Republican Chief Financial Officer Jimmy Patronis defeated former Democratic Sen. Jeremy Ring, keeping the office he was appointed to fill when Jeff Atwater resigned last year.

Patronis served eight years in the state House and was a member of the board that regulates the state's utilities when Scott appointed him the state's top finance official in June 2017.

Ring is a former Yahoo executive from Broward County. He served in the state Senate from 2006 to 2016.

AGRICULTURE COMMISSIONER

Republican state Rep. Matt Caldwell narrowly led Democratic lobbyist and lawyer Nikki Fried with nearly all votes counted in the race to replace departing Agriculture Commissioner Adam Putnam. The race could be headed to a recount as Caldwell's lead was just below the 0.5 percent margin needed to avoid one.

Caldwell is a real estate appraiser and seventh generation Floridian who served as chairman of the House Government Accountability Committee. He served eight years in the House.

Fried based a large part of her campaign advocating for the medical marijuana industry and criticizing the state's implementation of a constitutional amendment approved by voters allowing its use. Fried would be the first woman elected as Florida agriculture commissioner.

Putnam could not seek re-election because of term limits.

CONGRESS

Democrats captured two Republican seats in Miami, flipping the District 27 seat held by the retiring Republican Ileana Ros-Lehtinen. Democrat Donna Shalala, who served as President Bill Clinton's Health and Human Services secretary and as University of Miami president, defeated Republican Maria Elvira Salazar, a television journalist who worked for Spanish language networks.

Meanwhile in District 26, Democrat Debbie Mucarsel-Powell defeated Republican U.S. Rep. Carlos Curbelo. Mucarsel-Powell has worked for several nonprofit organizations in Miami-Dade County.

Elsewhere:

— Republican businessman and former Army Lt. Col. Michael Waltz in District 6 defeated Democrat Nancy Soderberg, a former United Nations ambassador and member of Bill Clinton's National Security Council. He will replace DeSantis, who resigned after winning the Republican gubernatorial primary.

— Republican state Rep. Ross Spano defeated Democrat Kristen Carlson for the District 15 seat held by retiring Rep. Dennis Ross. Carlson is a former prosecutor who also served as the general counsel for the Florida Department of Citrus.

— Republican state Sen. Greg Steube defeated Democrat Allen Ellison for retiring Tom Rooney's District 17 seat. Ellison replaced April Freeman on the ballot when she died after winning the primary.

— Democratic first-term U.S. Rep. Stephanie Murphy defeated Republican state Rep. Mike Miller in District 7.

— Freshman Republican U.S. Rep. Brian Mast defeated Democrat Lauren Baer, who was a senior adviser to Secretaries of State Hillary Clinton and John Kerry.

—Eight-term Republican U.S. Rep. Mario Diaz-Balart defeated Democratic former judge Mary Barzee Flores.

BALLOT QUESTIONS

Florida voters passed bans on greyhound racing, offshore oil drilling and using electronic cigarettes in most businesses, and made it more difficult for casino gambling to expand and taxes to be increased. The 12 constitutional amendments required 60 percent to pass and all but Amendment 1 passed. They number 1-7 and 9-13 after the state Supreme Court removed Amendment 8 from the ballot.

Amendment 13 banned dog racing in Florida by 2021. That's a blow to the industry that's been dwindling over the past two decades. Only five other states have active dog racing.

Amendment 4 could have a long-lasting impact on the state's politics as most felons who complete their sentences will now have their voting rights automatically restored. It does not apply to murderers and rapists. More than 1.4 million ex-felons couldn't vote in Florida, and critics of the felon voting ban say it disproportionally affects minority voters who tend to support Democrats.

Here are the other ballot questions:

— Amendment 1 was the only measure that failed. It would have increased the state's property tax homestead exemption from $50,000 to as much as $75,000 on homes worth more than $100,000. It was just below the 60 percent threshold.

— Amendment 2 passed. It will permanently keep in place a 10 percent cap on property tax assessments for commercial and rental properties that is current law, but is set to expire next year.

— Amendment 3 easily passed. It will require statewide voter approval to expand casino gambling in Florida, taking control out of the hands of the Legislature.

— Amendment 5 passed. It will require a two-thirds majority vote before the Legislature could increase taxes or fees.

— Amendment 6 passed, providing additional rights to crime victims and would raise the mandatory retirement age for judges from 70 to 75.

— Amendment 7 passed. It will require a supermajority vote before state university boards of trustees can raise fees. It will also pay death benefits, including help with education expenses, to the survivors of first responders who die on the job.

— Amendment 9 passed. It prohibits oil drilling in state waters and ban vaping in work places where smoking is already prohibited.

— Amendment 10 passed. It will require the state to create an Office of Domestic Security and Counter-Terrorism and maintain a Department of Veterans Affairs, which already exists. It also sets the start of the annual legislative session to January instead of March in even-numbered years and requires counties to elect a sheriff, tax collector, property appraiser, elections supervisor and circuit court clerk.

— Amendment 11 easily passed. It allows the Legislature to make some changes to criminal laws retroactive. It would also repeal language in the constitution that's now considered obsolete.

— Amendment 12 passed. It bans elected officials, agency heads, judges and others from paid lobbying while serving and for six years after leaving office instead of the current two.

___

For AP's complete coverage of the U.S. midterm elections: http://apne.ws/APPolitics