TALLAHASSEE, Fla. (AP) — Republican U.S. Sen. Marco Rubio has won a third term, defeating U.S. Rep. Val Demings and holding a key seat as the GOP tried to regain control of a closely divided Senate.

Rubio, 51, faced perhaps his toughest battle since he was first elected in 2010 after serving as the Florida House speaker. Once a presidential hopeful in 2016, Rubio’s name is less often mentioned as a potential 2024 candidate.

Rubio ran a campaign pulled from the Republican playbook, tying Demings to House Speaker Nancy Pelosi and President Joe Biden and hammering her on issues like spending, rising inflation and a crisis at the southern border.

The Republican was helped by shifting voter registration numbers in Florida. The last time Rubio ran for reelection, Democrats had about 327,000 more registered voters than Republicans. That has since flipped, with the GOP now having a nearly 300,000 advantage over Democrats.

Demings, 65, outraised Rubio and built a national profile by playing a prominent role in then-President Donald Trump’s first impeachment and being on then-candidate Biden’s list of potential running mates. But it wasn’t enough.

Much of her criticism of Rubio centered on a poor attendance record, his backing of a national abortion ban and questioning his honesty. She accused him of lying about her record and using GOP buzzwords like “socialist” and “radical” to condemn her.

Demings is finishing her third term in the U.S. House, but focused most of her campaign on her career in law enforcement, which included serving as Orlando’s first female police chief.

Rubio had relatively easy paths to his first two Senate victories, winning a three-way race in 2010 when sitting Republican Gov. Charlie Crist ran as an independent and peeled away votes from Democratic U.S. Rep. Kendrick Meek. Rubio then defeated U.S. Rep. Patrick Murphy in 2016 by nearly 8 percentage points.

Rubio ran for president in 2016, winning the Minnesota primary before dropping out of the race eventually won by Trump, who mercilessly mocked Rubio as “Little Marco.” Rubio initially said he wouldn’t seek a second Senate term, which led to a scramble of GOP candidates looking to fill his seat. But Rubio changed his mind just before candidate qualifying ended and easily held onto his seat in 2016.

As vice chairman of the Senate Select Committee on Intelligence and a member of the Committee on Foreign relations, Rubio has pushed for taking a harder line against China and returning manufacturing of critical supplies like prescription drugs to the U.S.

During his first Senate campaign, Rubio repeatedly reminded voters of his working class background and “only in America” story as the son of Cuban immigrants who became a U.S. senator. His father was a bartender and his mother a hotel maid.

Demings, who was hoping to become Florida’s first Black senator, used a similar “only in America” story. She grew up in Jacksonville, where segregation was still an issue, as the daughter of a janitor and maid. She was the first in her family to graduate from college and began her career in social work before becoming a police officer.

The economy weighed heavily on the minds of Florida voters. Three-quarters of them believe things in the country are heading in the wrong direction, according to AP VoteCast, an expansive survey of more than 3,300 voters in Florida. About half rank jobs as the most important issue facing the country.

Almost 8 in 10 voters say the nation’s economy is not so good or poor. When looking at their own family’s financial situation, about half describe it as holding steady while almost 4 in 10 say they are falling behind. However, 6 in 10 voters say they are confident they can keep up with their expenses and find a good job if needed.

For an overwhelming majority — roughly 9 in 10 voters — inflation was a factor in the election. For about 6 in 10, inflation was the single most important factor.

Meanwhile, nearly 7 in 10 voters say the U.S. Supreme Court’s decision to overturn the Roe v. Wade decision on abortion was an important factor in the election. About 6 in 10 say they favor a law guaranteeing access to legal abortion nationwide and a third opposed it.

Alyasha Shakir, a 50-year-old Broward County employee, said he was concerned about moves to eliminate access to abortion and voted for Demings. “You know the Senate is very important right now. We need all that we can get up in Washington right now for the Senate,” Shakir said while voting early in Fort Lauderdale.

In Orlando, a real estate agent and mother with her toddler strapped to her chest, who gave her name as Ashley S., said Tuesday she voted only for Republicans, because they supported keeping schools open during the pandemic. “I just want to keep Florida free,” she said.

___

Learn more about the issues and factors at play in the midterms at https://apnews.com/hub/explaining-the-elections.

And follow the AP’s election coverage of the 2022 elections at https://apnews.com/hub/2022-midterm-elections.