A war hero, a straight-talker and a political maverick - Republican Senator John McCain has been described as all the above.
A Vietnam veteran who survived five years as a prisoner of war, Mr McCain, 72, has risen through America's political ranks to become a vocal force on foreign policy and military affairs.
A self-styled common-sense-conservative, he beat off much younger rivals to secure the Republican party's nomination for president in early 2008.
His race against Barack Obama was close for months but, as the American public grew increasingly concerned about the faltering economy, the competition from the Democratic candidate ultimately proved too strong.
"We have come to the end of a long journey," he said in his concession speech. "The American people have spoken, and they have spoken clearly."
Mr McCain has never been afraid to adopt a controversial position.
A foreign policy hawk, he is one of the Iraq war's strongest supporters and backed the troop increase there known as the "surge".
Yet he described former Bush administration stalwart Donald Rumsfeld as "one of the worst secretaries of defence in history" and has hit out at the government's handling of the conflict.
He also opposed extraordinary rendition - the transporting of terror suspects to secret prisons in countries with less stringent interrogation rules - and the use of torture.
The senator has also not shied away from disagreements with the Republican Party over domestic policy.
The choice of Sarah Palin as running mate rallied social conservatives
He initially criticised President George W Bush's tax cut plans, saying on the Senate floor in 2001 that he "could not in good conscience support a tax cut in which so many of the benefits go to the most fortunate among us at the expense of middle class Americans".
He pulled back on that position in 2008, however, saying he wanted to retain all the Bush tax cuts because he believed low taxes and tax breaks for companies were the key to recovery for the US economy.
Over the years, Mr McCain has attracted the ire of many social conservatives for his relatively moderate views on civil unions, abortion and immigration reform.
Although he has since hardened some of his views, it took his choice of Alaska Governor Sarah Palin, a firm social conservative, as his running mate for the 2008 elections to really bring evangelical Christians on board.
But perhaps his biggest difference with the Bush administration is over climate change.
Mr McCain says he would sign up to a new treaty on climate change, provided that India and China were also included.
Mr McCain has not been afraid to work closely with Democratic colleagues in Congress to achieve his ends.
Mr McCain lost to Mr Bush in the battle for the Republican nomination in 2000
He co-sponsored legislation which sought to introduce carbon trading and binding carbon dioxide targets with independent Democratic Senator Joe Lieberman, who campaigned for him in 2008.
He also co-sponsored a bipartisan immigration bill in 2007 which, had it passed, would have offered an amnesty to illegal immigrants as well as tougher border controls.
His view that undocumented workers already in the US should be put on the path to citizenship is not in line with that of many of his fellow Republicans.
And he was the author, with Democratic Senator Russ Feingold, of a major reform of US campaign finance law in 2002 which aimed to reduce the influence of money and pressure groups in US elections.
Mr McCain's appeal to many is his character, which has been shaped by years of service in the US Navy.
The son of a senior navy admiral, Mr McCain graduated from the US Naval Academy in 1958 and began a 22-year career as a pilot.
Mr McCain had a 22-year career as a navy pilot before he entered politics
Deployed to Vietnam, he narrowly escaped death in July 1967 when, as he prepared to take off for a bombing raid, a missile exploded near his fuel tanks, sparking a fire on the ship that left 134 troops dead.
Three months later he was shot down over North Vietnam. Captured by Vietnamese fighters, he rejected the offer of early release linked to his father's prominence.
Instead, he was held prisoner for more than five years, experiencing frequent beatings and abuse which left him with limited movement in one arm.
After his return to the US he continued to serve, ultimately acting as naval liaison to the Senate until his retirement in 1981.
It was at this point that he moved to Arizona to embark on a political career, winning a congressional seat in 1982 and securing a Senate seat four years later.
Running against George W Bush for the 2000 presidential nomination, Mr McCain's direct style won him initial support and he secured a surprise victory in the New Hampshire primary.
But he was hit by a number of attacks as campaigning turned increasingly negative, and he later fell out with influential members of the so-called "religious right".
Mr Bush went on to win the nomination and Mr McCain returned to the Senate, serving as the ranking member of the influential Senate Armed Services Committee.
Battling Mr Obama for the White House, Mr McCain stressed his own experience in military and foreign affairs and argued that he would make a far better commander-in-chief.
As well as differing on Iraq policy, Mr McCain criticised Mr Obama for his willingness to talk directly to leaders of countries such as Syria and Iran.
He is himself a staunch proponent of a tough line against Tehran: at a campaign event in April 2007 he sang the words "Bomb Iran" to the tune of the Beach Boys' song, Barbara Ann, prompting widespread criticism.
He shrugged off the criticism, saying: "People got to lighten up, get a life."