PHOENIX, Arizona (CNN) -- Sen. John McCain conceded the 2008 presidential election to Democratic rival Barack Obama late Tuesday, congratulating him on a historic victory and pledging to work with him in the months ahead.
Sen. John McCain calms his supporters and congratulates Democratic rival Barack Obama on his victory.
"We have come to an end of a long journey. The American people have spoken, and they have spoken clearly," McCain said.
As he told the crowd that he had just spoken with Obama on the phone, boos echoed around the McCain headquarters.
The Arizona senator raised his hands to calm them. "Please," he said. Watch McCain calm crowd »
"Senator Obama has achieved a great thing for himself and his country," said McCain, calling Obama a "good man."
"This is an historic election, and I recognize the special significance it has for African-Americans and for the special pride that must be theirs tonight."
Appearing with McCain was his running mate, Alaska Gov. Sarah Palin.
McCain called Obama at 11 p.m. when polls closing on the West Coast gave Obama the electoral votes to become the nation's first black president.
Obama thanked McCain for his graciousness and said he had waged a tough race, according to Obama spokesman Robert Gibbs. Watch Obama supporters go wild »
The new president-elect told McCain that he was eager to sit down and talk about how the two of them can work together. "I need your help, you're a leader on so many important issues," Obama told McCain.
In his victory speech to the nation, Obama said, "I just received a very gracious call from Senator McCain. ... I congratulate him and Governor Palin for all they have achieved, and I look forward to working with them to renew this nation's promise in the months ahead."
McCain urged his supporters to "join me in not just congratulating [Obama], but offering our next president our good will and earnest effort to find ways to come together to find the necessary compromises to bridge our differences and help restore our prosperity, defend our security in a dangerous world, and leave our children and grandchildren a stronger, better country than we inherited." Read transcript of McCain's speech
There had been long faces at the Biltmore Hotel for much of the night as McCain allies watched returns on televisions around the hotel. Among the guests floating around McCain headquarters were actor Jon Voight and former Sen. Phil Gramm of Texas.
Earlier in the day, McCain made a final push through three key Western states -- Colorado, Nevada and New Mexico. Obama ended up winning all three states.
"The Mac is back," McCain earlier told a pumped-up crowd in Grand Junction, Colorado. "Stand up and fight. America is worth fighting for." Watch McCain tell crowd "the Mac is back" »
Palin, voted in her home town of Wasilla, Alaska, on Tuesday morning. She later headed to Arizona to join McCain.
"So glad to get to be home in Wasilla to cast this vote because forever I'm going to be Sarah from Alaska," Palin said after voting. "It's an honor to get to be here with my friends and family." Watch Palin cast vote in Alaska »
At 72, McCain would've been the oldest first-term president in the nation's history. Instead, he lost to the first African-American to ever win the presidential election.
Tuesday also marked the end of the longest presidential campaign season in U.S. history -- 21 months -- and both candidates took the opportunity to make their final pitch to voters. View pictures of America voting »
As McCain and Obama emerged from their parties' conventions, the race was essentially a toss-up, with McCain campaigning on his experience and Obama on the promise of change. But the race was altered by the financial crisis that hit Wall Street in September.
Obama began to pull away in the polls nationally as well as in key battleground states.
Born the son and grandson of admirals, McCain has been driven by a sense of duty his entire life. McCain has a family legacy that took him to the U.S. Naval Academy in Annapolis, Maryland. After graduating in 1958, he became a Navy fighter pilot and volunteered to serve in Vietnam.
In one of the most defining events in his life, McCain was shot down while flying a combat mission over Vietnam in 1967. He was captured by the Communist Viet Cong and spent 5½ years in a prisoner of war camp, where he was often tortured.
Despite suffering pain from his crash and torture, McCain refused to be released before others who had been in captivity longer. He returned to the United States in 1973.
"During the years, we were kept in solitary confinement or two or three to a cell because they didn't want us to see each other. We'd spend all our time tapping on the walls to each other and encouraging each other and organizing, organizing, organizing with our chain of command. The days and hours go by," McCain once told CNN.
"But, you know, the camaraderie, the friendship, the love that we had for each other was still the most remarkable experience of my life. They're the ones I know best and love most."
McCain entered politics nearly a decade after his return, when he ran for and won an open House seat in Arizona in 1982. In 1986, McCain easily won Arizona's Senate seat and has been re-elected three times.
At his headquarters Tuesday, McCain said he had no regrets and Americans shouldn't either.
"I wish Godspeed to the man who was my former opponent and will be my president. And I call on all Americans, as I have often in this campaign, to not despair of our present difficulties, but to believe, always, in the promise and greatness of America."
CNN's Dana Bash and Scott Anderson contributed to this report.