Washington (AFP) - Accusations of racism flared up on Wednesday in the Florida governor's race after the Republican candidate told voters they would "monkey this up" if they chose a liberal African-American Democrat backed by Senator Bernie Sanders.

The upset victory by Democrat Andrew Gillum, 39, in the Florida gubernatorial primary was the most notable of a slate of party primaries held on Tuesday to decide candidates for the midterm election.

Gillum's opponent in November will be Representative Ron DeSantis, an enthusiastic backer of President Donald Trump who surged in the polls in Florida, America's third-largest state, after earning the endorsement of the president.

DeSantis, also 39, landed in hot water within hours of his primary victory, however, with comments to Fox News which were interpreted by some as being racially charged.

Speaking of his opponent, who is seeking to become Florida's first black governor, DeSantis said "the last thing we need to do is to monkey this up by trying to embrace a socialist agenda with huge tax increases and bankrupting the state."

"That part wasn't lost on me," Gillum responded on Fox News when asked about the "monkey this up" comment.

"It's very clear that Mr DeSantis is taking a page directly from the campaign manual of Donald Trump," he said. "In the handbook of Donald Trump, they no longer do whistle calls. They are now using full bull horns."

DeSantis spokesman Stephen Lawson rejected any racial overtones.

"Ron DeSantis was obviously talking about Florida not making the wrong decision to embrace the socialist policies that Andrew Gillum espouses," Lawson said in a statement. "To characterize it as anything else is absurd."

In other races, a former air force fighter pilot, Representative Martha McSally, won the Republican primary in Arizona to replace the retiring Republican Senator Jeff Flake, a vocal critic of Trump.

With 52 percent of the vote, McSally easily defeated arch conservative Kelli Ward, a former state senator, and Joe Arpaio, an immigration hardliner who was convicted of criminal contempt and pardoned by Trump last year.

Story continues

Trump had mostly stayed out of the race but he endorsed the 52-year-old McSally on Wednesday, saying she was "strong on crime" and "the border."

- 'We were counted out' -

McSally will take on Democrat Kyrsten Sinema as Republicans seek to hold on to their slim 51-49 majority in the Senate in November.

Democrats had been hoping for a victory by one of the right-wing candidates -- Ward or Arpaio -- in a bid to increase their chances of capturing the seat.

A replacement for the other senator from Arizona, the late John McCain, is to be named in the next few days by the southwestern state's Republican governor and will be up for election in 2020.

Trump welcomed DeSantis's victory in Florida and criticized Gillum, the mayor of Tallahassee, the Florida capital.

"Not only did Congressman Ron DeSantis easily win the Republican Primary, but his opponent in November is his biggest dream... a failed Socialist Mayor named Andrew Gillum who has allowed crime & many other problems to flourish in his city," Trump tweeted. "This is not what Florida wants or needs!"

DeSantis's campaign featured an ad in which he encourages his toddler to use blocks to "build the wall" -- a reference to Trump's border wall with Mexico -- and dresses his baby in a "Make America Great Again" outfit.

Gillum, who has called for Trump's impeachment, is the first African-American to win Florida's Democratic nomination for governor and his surprise win came against better-funded, more mainstream opponents.

"We were counted out every step of the way," Gillum said. "My four opponents collectively spent over 90 million dollars. I think our total spending may have been six."

If elected, Gillum promised to work for universal health care and "common sense" gun laws in a state where there has been a spate of mass shootings.

Sanders, who represents the left wing of the party and came up short in his 2016 challenge to Hillary Clinton for the Democratic presidential nomination, welcomed his victory.

"Floridians joined Andrew in standing up and demanding real change and showed our nation what is possible when we stand together," the Vermont senator tweeted.

Also in Florida, current governor Rick Scott won the Republican Senate nomination and is set to take on Democratic Senator Bill Nelson in November.

Nelson, 75, has represented Florida in the Senate since 2001 but the latest polls show Scott with a slight lead in what is expected to be one of the most expensive congressional races.

All 435 seats in the House of Representatives will be up for grabs in November along with 35 seats in the 100-member Senate.

The midterm elections in Arizona and Florida are being closely watched as harbingers of how the key states may vote in the 2020 presidential election.