SIMI VALLEY, California (Reuters) - Republican Rudy Giuliani and Democrat John Edwards abandoned their failing U.S. presidential bids on Wednesday, narrowing the race in both parties to two main candidates ahead of next week’s multi-state round of voting.

Giuliani, the one-time front-runner who finished a distant third in Florida’s Republican primary on Tuesday, traveled to California to endorse Arizona Sen. John McCain in a hard-fought Republican battle against former Massachusetts Gov. Mitt Romney.

“Today I am officially announcing my withdrawal as a candidate for president of the United States,” Giuliani said at the Ronald Reagan presidential library in Simi Valley before a Republican presidential debate.

“John McCain is the most qualified candidate to be the next commander-in-chief of the United States.”

Edwards traveled to New Orleans, where he launched his campaign more than a year ago, to make the surprise announcement that he was folding his campaign. Edwards vowed last week to stay in the race until Tuesday, when almost half the U.S. states vote on candidates for the November election.

The withdrawal of Edwards, who campaigned as the champion of low- and middle-income families, left former first lady Hillary Clinton facing Illinois Sen. Barack Obama for the Democratic nomination in what seemed likely to be a long, bruising struggle.

“It is time for me to step aside so that history can blaze its path,” Edwards, a former North Carolina senator, told supporters in a New Orleans neighborhood devastated by Hurricane Katrina in 2005.

Regardless of whether Obama or Clinton wins, Democrats will field a history-making ticket, the first time a black or woman has headed a major U.S. political party’s presidential ticket.

“We do not know who will take the final steps to 1600 Pennsylvania Avenue, but what we do know is that our Democratic Party will make history ... and with our convictions and a little backbone we will take back the White House in November,” Edwards said.

Edwards did not immediately endorse either of his rivals.

The candidates are in the early stages of a state-by-state battle to pick Republican and Democratic presidential nominees. The winners from the two parties will face off in the November 4 election to succeed President George W. Bush.

Giuliani’s withdrawal leaves McCain facing a strong challenge from Romney.

Former Arkansas Gov. Mike Huckabee is still formally in the Republican race but his lack of campaign money and limited appeal beyond Christian conservatives has left him trailing far behind.

Slideshow ( 16 images )

Giuliani did little campaigning in the early voting states, focusing his efforts on producing a strong showing in Florida, the fourth most-populous state with a large number of retirees from the Northeast.

But he finished a disappointing third place, barely above Huckabee.

(Additional reporting by Russell McCulley in New Orleans, Jeff Mason in Denver and Ellen Wulfhorst in Little Rock; writing by David Alexander; Editing by John O’Callaghan)