John McCain edged out Mitt Romney to win the Florida Republican primary on Tuesday, with Rudy Giuliani posting a poor showing that could signal the end of his pursuit of the Republican nomination.

Giuliani was set to endorse McCain on Wednesday, according to the Associated Press and other news outlets.

Meanwhile, Hillary Clinton easily won the state’s Democratic primary over Barack Obama, although the race was nothing more than a beauty contest as the state was stripped of its delegates in a dispute with the national party.

The Democratic candidates had pledged not to campaign in the state, leaving much of the attention to the five remaining GOP candidates.

In the latest returns, McCain was leading with 36% the vote to Romney with 31%. Although the win was narrow, McCain collects all of the state’s 57 delegates and builds momentum going into Super Tuesday on Feb. 5.

“Our victory may not be of landslide proportions, but it is sweet nonetheless,” McCain told supporters after his win.

Written off last summer as his campaign sputtered, McCain hung on, paring his campaign staff as fund-raising dropped and it became difficult for him to even find event co-hosts. But in a sign of his reversal of fortune, McCain will raise money at the home of MGM chief Harry Sloan on Thursday.

In fact, when it came to Hollywood support, Giuliani had been gathering many of the high-profile GOP endorsements and fund-raisers. Robert Duvall raised money for him at his home, and Jon Voight stumped for him throughout Florida. Giuliani’s third place showing — with 15% of the vote — was especially stinging because he had set up an extensive California operation in anticipation of next week’s vote.

But his campaign deployed a risky strategy: devote resources to larger and less conservative states, and all but avoid the smaller but early-voting contests of Iowa and New Hampshire.

Speaking in Orlando to supporters, Giuliani did not say that he was dropping out but talked in the past tense.

“Like most Americans, I love competition,” he said. “I don’t back down from a principal fight but there must be a larger purpose.”

As if saying farewell, he also complimented all of the remaining candidates in the field, even joking about Ron Paul “who won all those debates.” He sparred frequently with Paul, a vocal opponent of the war in Iraq.

It’s doubtful then that Giuliani would participate in the GOP debate on Wednesday at the Reagan Library. The forum could be their final debate, with chances that the Super Tuesday contest will determine a nominee.

McCain’s win, and an endorsement from Giuliani, would make him the front runner among California’s moderate Republicans. McCain also is the likely heir to much of Giuliani’s support in the entertainment industry, which could help give him a needed infusion of campaign money.

Moreover, McCain already has extensive ties to the business, having long served on the Senate Commerce Committee.

Sloan said that he actually sought out McCain in the summer of 2006 and, after meeting at the Beverly Hilton, agreed to help out his presidential bid. He hosted a fund-raiser for McCain in Janurary, 2007, where he told those gathered that he thought that the Arizona senator was “the most principled political leader of our generation.”

Sloan predicted that McCain could hold appeal to Hollywood independents or even Democrats. They would have to overlook his strident support for the troop surge in Iraq. Although McCain is anti-abortion and holds conservative views on some social issues — a turnoff even to many Hollywood Republicans — he’s not regarded as beholden to the religious right.

In fact, McCain’s maverick status, a liability to some in his own party, is a key to his support in entertainment.

“I do think that once the Democratic race is decided, some Democrats will give John a good look,” Sloan said.

It’s not so far fetched, as the race between Clinton and Obama turns increasingly acrimonious. And there are signs that it has spilled to the donor level in Hollywood — where the competition for campaign dollars has until recently been a friendly rivalry. Sources say that some Obama supporters are considering supporting other candidates — even McCain — should Clinton become the nominee.

The latest is a dispute over whether Florida actually counts for anything. Clinton won with 50% of the vote to Obama’s 33%.

Clinton appeared there on Tuesday night, and said of her win, “I am thrilled to have 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.”

If anything, Clinton’s appearance in Florida may make more of a psychological difference to the campaign, after suffering a big loss on Saturday in the South Carolina and the key endorsement of Sen. Edward Kennedy.

Obama’s campaign tried to minimize the importance of Florida, noting its lack of delegates. Kerry, who has endorsed Obama, told reporters on Tuesday morning that “the bottom line is that Florida does not offer any delegates. It is not a legitimate race. It should not become a ‘spin’ race. It should not become a fabricated race.”