WASHINGTON (CNN) -- Born the son and grandson of admirals, Sen. John McCain has been driven by a sense of duty his entire life.
John McCain won an open House seat in Arizona nearly a decade after returning from Vietnam.
Born in the Panama Canal Zone in 1936 while his father was stationed there, 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 what may be the defining event 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 told CNN's John King.
"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.
"In those earlier days, he was still a guy. He was that guy who came back from Vietnam, that guy who was having a good time in the Senate. He wasn't as polished as he is now, and his personality is intense," said E.J. Montini, a writer for the Arizona Republic. "He's not as confrontational in an interview situation as he may have been at another time. That has changed, but in those early days, he definitely was. It was very entertaining." See timeline of McCain's life »
McCain's early Senate career focused on an issue he knew well: Vietnam. He worked with fellow Vietnam veteran Sen. John Kerry, D-Massachusetts, to investigate whether POWs were still being held in Vietnam. They found none. McCain also pushed for a normalization of diplomatic relations with the country that had once held him captive.
McCain was also assigned to the Senate Commerce committee and would eventually become the committee's chairman.
In 1986, McCain was investigated as being one of five senators, dubbed the "Keating Five," who met with regulators on behalf of Charles Keating, the owner of an Arizona savings and loan. He was later cleared.
During his Senate career, McCain developed the reputation of being a maverick and bucking his party's leadership. Watch Cindy McCain describe her marriage as an 'adventure' »
On what could be considered McCain's signature issue, campaign finance reform, McCain worked with Sen. Russ Feingold, D-Wisconsin, in 2002 to pass what may be his signature legislative accomplishment -- the McCain-Feingold campaign finance legislation -- over the objections of the Republican leadership.
In 2005, McCain again took a position counter to the majority of his party by working with Sen. Edward Kennedy, D-Massachusetts, to write immigration reform legislation, a measure conservatives dismissed as "amnesty" for illegal immigrants. McCain again tried to pass bipartisan immigration legislation in 2007, but the effort stalled in the Senate. Test your knowledge about McCain »
McCain took his maverick reputation on the campaign trail in 2000, criss-crossing New Hampshire in his "Straight Talk Express" campaign bus and answering voter questions. His candid responses made McCain a favorite of New Hampshire's independent votes and the media.
He went on to upset then-Texas Gov. George Bush, the candidate backed by the party establishment, in the New Hampshire primary, capturing 49 percent of the vote to Bush's 30 percent.
McCain's 2000 campaign ended quickly after New Hampshire, however. When the race moved on to South Carolina, social conservatives rallied around Bush and worked hard to defeat McCain. The South Carolina primary fight was particularly nasty, and rumors swirled that McCain had fathered a black illegitimate baby. (He and wife Cindy, in fact, had adopted a daughter from Bangladesh.) Bush went on to beat McCain 53 percent to 42 percent.
After South Carolina, McCain scored another upset in the 2000 Michigan primary, but he further alienated social conservatives, a key Republican voting bloc, when he blasted Pat Robertson, Jerry Falwell and other evangelical leaders as "agents of intolerance."
Bush captured the Republican nomination and the White House.
Bitter feelings between the McCain and Bush camps remained after the 2000 election, and McCain opposed Bush's tax cut proposal, arguing that it would increase the federal deficit.
But McCain became one of Bush's strongest backers in the war on terrorism, including the U.S. invasion of Iraq in 2003. McCain campaigned for Bush's re-election in 2004.
After the Democrats took control of Congress with the 2006 elections, McCain became one of the most vocal critics of their plans to force the president to withdraw troops from Iraq. Although he was a fierce critic of then-Defense Secretary Donald Rumsfeld and the administration's war strategy, McCain claimed that a precipitous withdrawal would damage U.S. national security and argued that more, not fewer, troops should be sent to Iraq to increase security there.
Bush adopted the "surge" strategy in early 2007, and the increased troop levels largely succeeded in reducing violence across Iraq.
As McCain prepared to run again for president in 2006, he gave a speech at Falwell's Liberty University, a move read as an attempt to close any remaining rift with social conservatives. He also argued that Bush's tax cuts should be extended past 2011, a move seen as a way for McCain to improve his standing among the party's economic conservatives.
In spring 2007, McCain launched his presidential bid among a crowded field of candidates. The GOP candidates included former New York Mayor Rudy Giuliani, who made national security his signature issue; former Massachusetts Gov. Mitt Romney, a favorite of many in the party's conservative base; former Arkansas Gov. Mike Huckabee, a former Baptist preacher who struck a populist tone and enjoyed the support of evangelicals; and actor and former Sen. Fred Thompson, who many hoped could recreate Ronald Reagan's political magic.
As McCain began his second bid for the White House, he trailed Giuliani in the national polls and attempted to run a more traditional presidential campaign than his 2000 effort. His fundraising lagged, however, and in summer 2007 his campaign nearly went broke, forcing him to lay off much of his campaign staff. Many political observers wrote McCain off.
But McCain continued, reverting to the campaign style that worked for him in 2000: riding the "Straight Talk Express" and answering thousands of voter questions at town hall meetings.
Though Huckabee won the Iowa caucuses with strong support of evangelicals, McCain re-created the magic of 2000 and won the 2008 New Hampshire primary with 37 percent of the vote, edging out Romney. See photos from the campaign trail »
McCain lost to Romney in Michigan a week later, but he won South Carolina and then Florida, which knocked Giuliani out of the race.
On Super Tuesday, McCain won the large states of California, New York and Illinois, which effectively ended Romney's White House run. However, Huckabee did well in the South -- an indication to some that evangelicals were dissatisfied with McCain -- and stayed in the race until McCain won enough delegates to secure the nomination with wins in Texas and Ohio on March 4.
Since securing the GOP nomination in March, McCain has focused on fundraising and town hall events across the country. He challenged Sen. Barack Obama, the presumptive Democratic presidential nominee, to join him in a series of town hall meetings, but Obama declined.
As he prepares to accept the Republican presidential nomination in Minneapolis-St. Paul, Minnesota, McCain will probably return to the lessons he learned from his father and grandfather: a duty to country above all others.