With McCain at his side, Giuliani called the Arizona Senator "the most qualified candidate to be the next commander in chief of the United States."
"This is a man prepared to be President of the United States at a time of great peril," Giuliani added.
McCain acknowledged his former rival as "my strong right arm and my partner."
"This man is a national hero and I'm honored by his friendship," he said.
The former New York City mayor went on to call for a "stronger and broader Republican Party."
"I'm hopeful we can secure his election very soon so we can unite our party and begin the process of uniting our nation," Giuliani said.
The announcement took place just after 6 p.m. ET at the Ronald Reagan Presidential Library and Museum in Simi Valley, Calif.
Giuliani vowed to campaign for McCain in whatever capacity he is asked.
"When I believe in a man like I do John McCain, this will become to me as important as my own election was," Giuliani said.
"I expect him to be fairly active for McCain," said Rep. Peter King, a New York Republican and adviser to Giuliani. "There is a real friendship and respect between the two," he said.
Once the Republican presidential front-runner, Giuliani suffered a debilitating defeat in Tuesday's Florida primary.
The former mayor finished a distant third to the winner, McCain, and close second-place finisher.
Speaking to supporters Tuesday night, Giuliani delivered a valedictory speech that was clearly more farewell than fight-on.
"I'm proud that we chose to stay positive and to run a campaign of ideas in an era of personal attacks, negative ads and cynical spin," Giuliani said as supporters with tight smiles crowded behind him. "You don't always win, but you can always try to do it right, and you did."
Tuesday's result was a remarkable collapse for Giuliani. Last year, he occupied the top of national polls and seemed destined to turn conventional wisdom on end by running as a moderate Republican who supported abortion rights, gay rights and gun control.
The results seriously decimated Giuliani's unconventional strategy, which relied heavily on Florida to launch him into the coast-to-coast Feb. 5 nominating contests.
But Florida proved to be less than hospitable. His poll numbers dropped and key endorsements went to McCain.
While Giuliani had hoped that his presidential campaign would serve as an example of how an unorthodox strategy could propel a candidate to his party's nomination, it instead appears more likely to be remembered as a cautionary tale, reports CBSNews.com's Brian Montopoli.
While his rivals were making headlines for their early victories, the former New York City mayor faced a flood of negative stories about his personal life and judgment, many tied to third wife Judith Nathan and disgraced longtime ally Bernard Kerik.
"Giuliani got a significant amount of bad press for about a week and a half for personal issues while everybody else was getting good press from the early primaries," said Tallahassee-based political consultant Brett Doster. "The negative personal stories combined with the resurgence of John McCain - the only guy in the field who had more credibility on national security - began to suck all the oxygen away from Giuliani's part of the aquarium." (
Surveys of voters leaving polling places Tuesday showed that Giuliani was getting backing from some Hispanics, abortion rights supporters and people worried about terrorism, but was not dominating in any area.
McCain, addressing his own supporters moments later in Miami, gave Giuliani a warm rhetorical embrace.
"I want to thank my dear friend, my dear friend Rudy Giuliani, who invested his heart and soul in this primary and who conducted himself with all the qualities of the exceptional American leader he truly is," McCain said. "Thank you, Rudy, for all you have added to this race and for being an inspiration to me and millions of Americans."
Kathy Frankovic, director of surveys for CBS News, said it is likely many of those who favored Giuliani will now support McCain. (Read more from Frankovic on who the Giuliani and Edwards departures help in the two races.)
Giuliani hung his bid for the Republican presidential nomination on his leadership. His stalwart performance as New York mayor in the tense days after the Sept. 11, 2001, terrorist attacks on New York and Washington earned him national magazine covers, international accolades and widespread praise.
Steadfast in a crisis, as a candidate Giuliani was a bundle of contradictions, so much so that he liked to joke that even he didn't always agree with himself.
A moderate-to-liberal New Yorker who backed abortion rights, gay rights and gun control in a party dominated by Southern conservatives, Giuliani became a Republican mayor of an overwhelmingly Democratic city. Campaigning for national office, he claimed to have created the most conservative government in the most liberal city in America.
After earning a reputation as a tough-talking, even abusive executive, Giuliani the presidential candidate was mostly mild-mannered in debates, even as those around him got meaner.
Giuliani, 63, first gained prominence as a crime-busting federal prosecutor in New York City. Jailing mob bosses, Wall Street executives and corrupt politicians helped propel his next career as a politician, but it wasn't an immediate success. He lost the first time he ran for mayor in 1989 before winning in 1993.
As mayor, he fostered a take-charge image by rushing to fires and crime scenes to brief the press, but some critics felt he was more concerned about taking credit from others for what became a historic decline in the city's crime rate during his tenure.
A bout with prostate cancer and the very public breakup of his marriage with second wife Donna Hanover - she first learned he was filing for divorce when he made the announcement at a televised news conference - forced Giuliani to withdraw from a race for the U.S. Senate against Democrat Hillary Rodham Clinton in 2000. The messy divorce was revisited in awkward detail once he re-entered politics.
With no working strategy in his presidential campaign, no primary victories and dwindling resources, the mayor's third-place finish in Florida spelled the end of his run, even if his crestfallen supporters couldn't believe it.
"They'll be sorry!" a woman with a New York accent called out to the mayor as he spoke. "You sound like my mother," Giuliani joked.