McCain comes from a family with a long military history - both his father and grandfather served as US navy admirals.
McCain himself joined the navy in 1958, beginning a 22-year long naval career marked most notably by his decision to volunteer for service in the Vietnam war.
It was a momentous decision. In October 1967 during a bombing mission, McCain's plane was shot down by a missile.
He ejected but was injured in the process, breaking both his arms and his leg.
Captured by north Vietnamese soldiers, he was taken prisoner and held at several prisons for five and a half years, often enduring torture by his captors. He still bears physical scars from his ordeal.
Most notably, though he was offered an early release by the North Vietnamese, McCain declined because he did not want to be seen as receiving preferential treatment.
On his return, McCain decided to enter politics, becoming first a naval liaison for the US senate, then a congressman for Arizona before entering the senate in 1987.
On foreign policy, many prospective voters were unnerved by a comment McCain made while campaigning in which he said he believed US forces should stay in Iraq for 100 years if necessary.
Tehran must understand that it cannot win a showdown with the world
"I oppose a pre-emptive withdrawal strategy that has no Plan B for the aftermath of its inevitable failure and the greater problems that would ensue," he wrote in Foreign Affairs magazine.
However, McCain has criticised US military strategy in Iraq, saying that by failing to adopt a counterinsurgency strategy the US and the Iraqi people had paid a "dear price".
He is also a firm opponent of the use of torture. However, he recently voted against a senate bill which would have banned the controversial interrogation method of waterboarding widely viewed as torture.
McCain also advocates building up Israel militarily and isolating Hamas, while using every resource available "to aid moderate Muslims ... who are resisting the well-financed campaign of extremism that is tearing Muslim societies apart", he added.
On Iran, McCain is hawkish, describing the nation as the world's "chief state sponsor of terrorism" and advocating all options, including possible military action, against the Islamic Republic should it continue with its nuclear programme.
"Tehran must understand that it cannot win a showdown with the world," he wrote.
However, an embarrassing gaffe during a visit to Jordan in March, in which he wrongly accused Iran, a predominantly Shia nation, of aiding Sunni al-Qaeda fighters, led to questions about whether his foreign affairs experience was as solid as he claimed.
McCain remains a polarising figure within the Republican party.
|McCain was left embittered after his 2000
nomination battle with Bush[EPA]
On domestic issues McCain is known for being willing to "cross the floor" and work with Democrats, particularly on the matters of campaign finance and on immigration - co-sponsoring a bi-partisan bill which would have offered an amnesty to illegal immigrants.
This has caused suspicion amongst some of the more traditionalist members of the Republican party, who consider him too moderate on social issues such as immigration.
McCain's response has been to aggressively tout his conservative credentials while out on the road campaigning for the nomination, attempting to strike a delicate balance by reaching out to centrists who may be wooed to vote for him while at the same time striving not to upset evangelicals or more right-wing members of the Republican party.
Two decades ago, McCain and four other senators were accused of trying to influence banking regulators on behalf of Charles Keating, a savings financier later convicted of securities fraud.
The Senate Ethics Committee decided that McCain had used "poor judgment" but that his actions 'were not improper" and did not deserve punishment.
In 2000 McCain ran against George Bush, losing after a controversial nomination race in which scurrilous accusations against him implied erroneously he had fathered an illegitimate African-American child.
The experience, he later acknowledged, left him angry - although his relationship with Bush has since thawed.
Nonetheless, sensitised by the slurs against him in the 2000 nomination campaign, McCain set up a "South Carolina truth squad' to rebut allegations that he had "sold out" prisoners of war.
In February, he also denied a New York Times report that suggested he had a romantic relationship with a Washington lobbyist.
However, with the potential slings and arrows of a major presidential campaign, McCain may face more of the same in the future.