John McCain has won a close victory in Florida in the battle to become the Republican candidate for US president.
The Arizona senator narrowly beat Mitt Romney in the primary election to gain the upper hand ahead of next week's crucial polls in 24 states.
Media reports suggest former New York Mayor Rudy Giuliani - who based his campaign on winning in Florida - may endorse Mr McCain and drop out.
Hillary Clinton won a largely symbolic victory in the Democratic vote.
No delegates are at stake for the Democrats because the state's Democratic Party has been penalised by the national party for breaking rules on when it could hold its primary.
The BBC's Kevin Connolly in Orlando says Mr McCain's win probably makes him a slight front-runner going into Super Tuesday - but the closeness of the margin may also encourage Mr Romney.
Observers can expect things to be equally tight on Super Tuesday, our correspondent adds.
With 99% of the vote counted, Mr McCain led Mr Romney by 36% to 31%.
The result means Mr McCain will take all 57 delegates in what is a winner-takes-all primary - the biggest prize of the primary season so far.
The delegates will attend the party's national convention later this year when the Republican candidate is chosen.
Speaking to cheering supporters at a rally in Miami, Mr McCain said: "Our victory might not have reached landslide proportions, but it was sweet nonetheless."
He said he believed he would win the Republican nomination and would go on to win "against anyone the Democratic Party nominates".
"Tonight, my friends, we celebrate but tomorrow it's back to work. We have a ways to go but we are getting close."
Mr McCain's Florida victory follows a win for the Arizona senator in South Carolina 10 days ago and another in New Hampshire on 8 January.
In campaigning, Mr McCain focused on national security and had the benefit of strong support among a large number of military servicemen and veterans in the state.
Mr Romney, speaking in St Petersburg, Florida, said he had telephoned Mr McCain to offer his congratulations.
A former businessman and ex-governor of Massachusetts, Mr Romney has presented himself as someone with the credentials to shore up the economy.
He said he would be appearing at the Republican presidential debate in Simi Valley, California, on Wednesday night.
Mr Giuliani - who had put almost all his effort into campaigning in Florida - was in third place with 15%.
Speaking to his supporters, he congratulated his opponents on running a "hard-fought campaign".
He was non-committal about his own future in the race but officials have been quoted as saying he intends to endorse Mr McCain for the nomination on Wednesday.
Mr Giuliani said: "I don't back down from a principle fight, but there must always be a larger purpose.
"Elections are about a lot more than just a candidate. Elections are about fighting for a cause larger than ourselves."
Mike Huckabee, who won in Iowa but needed a good result in Florida to keep him in contention, was fourth with 13%. Texas Congressman Ron Paul was fifth with 3% of the vote.
Mr Huckabee thanked his activists in Florida and said of his campaign: "It's not even close to being over. We like to believe we are just getting started."
None of the Democratic candidates campaigned in Florida after the party's national committee penalised Florida for holding its primary early.
But Hillary Clinton - who has said she wants the state's delegates reinstated and seated at the national convention - held a victory rally in Davie, Florida, as the results came in.
Senator Clinton secured 50% to chief rival Barack Obama's 33%, with John Edwards in third with 14%.
She told supporters: "I am thrilled to have had this vote of confidence that you have given me today and I promise you I will do everything I can to make sure not only are Florida's Democratic delegates seated, but Florida is in the winning column for the Democrats in 2008."
Mr Obama told reporters he believed the decision on delegates "should be made after the nomination, not before".
Mr Obama spent the day campaigning in Kansas, another Super Tuesday state.
He also picked up the endorsement of Kansas Governor Kathleen Sebelius, who delivered the Democratic response to President George W Bush's State of the Union address on Monday.