McCain, an Arizona senator, held a 36 per cent to 31 per cent lead over Romney, a former Massachusetts governor, with more than two-thirds of Florida's precincts counted.
McCain has called for years for more US troops to be sent to Iraq.
He has also said he sees "signs of success" in the current US troop "surge" strategy which he regards as a springboard to re-launch a campaign based heavily on the so-called "war on terror".
"It shows one thing. I'm the conservative leader who can unite the party,'' McCain said on Tuesday.
The victory gives McCain important momentum ahead of next week's "Super Tuesday" polls, when over 20 states will vote in the presidential race.
Mike Huckabee, the former governor of Arkansas, came in fourth in the Republican race.
Hillary Clinton won the Florida Democratic primary, an event that drew no campaigning by any of the candidates.
Florida was stripped of its nominating delegates for violating party rules and bringing forward the date of its vote.
"I am convinced that with this resounding vote, with the millions of
Americans who will vote next Tuesday, we will send a clear message that America is back and we will take charge of our destiny once again," she said at a rally following her victory.
McCain gained his first primary win in a state that allowed only Republicans to vote.
His previous victories, in New Hampshire and South Carolina this year, came in elections open to independents.
He had campaigned with the support of the state's two top Republican elected officials, Charlie Crist, the governor, and Senator Mel Martinez.
Economy 'top issue'
Romney, the former governor of Massachusetts, has so far won only in the Michigan primary, the state where he grew up, although he also won caucuses in Wyoming and Nevada.
Why Democrats skipped Florida
Democratic candidates did not campaign in Florida after the party stripped the state of its 185 delegates as punishment for holding its primary ahead of "Super Tuesday" on February 5.
The same thing happened in Michigan, which was stripped of its 156 delegates.
The Florida race was won by Hillary Clinton but the votes have no official bearing on the selection of the party's nominee in August.
Clinton's team is pushing for the Florida and Michigan votes to count.
An exit poll showed the economy was the top issue for nearly half the Republican electorate.
Terrorism, the war in Iraq and immigration followed in importance, according to the poll.
In a state that is a magnet for retirees, more than one-third of the voters were 65 or older.
According to the poll, McCain benefited from the support of Latinos and older voters.
Romney got support from voters opposed to abortion and opposed to making it easier for illegal immigrants to get US citizenship.