Washington - From a tiny cell in North Vietnam in the late 1960s, John McCain told his fellow prisoners of war that someday he would be president of the United States. They all had a good laugh.
United States Senator and Republican presidential nominee John McCain (Republican-Arizona) speaks at Trent Arena during a campaign stop in Kettering, Ohio, USA, 27 October, 2008. EPA/MARK LYONS
About 40 years later, if his run for the White House succeeds, he would be the oldest president ever to begin his first term. But it is a challenge for McCain, 72, who must counter the fund-raising ability and popularity of his Democratic rival Barack Obama while distancing himself from the ever-less-popular US President George W Bush.
In the critical days before the November 4 elections, he also has had to contend with a depleted campaign war chest, low morale and reported infighting within a campaign looking for scapegoats.
The Arizona senator rose through the country's political ranks with his straight talking style, hawkish foreign policy and a maverick reputation within his own party.
But he also angered party conservatives with his relatively moderate views on immigration and campaign finance reform.
One of his toughest tasks was energizing and uniting the party ahead of the elections. To strengthen his position he chose cultural conservative Alaska Governor Sarah Palin as his running mate. The move electrified the Republican base, but it later proved to alienate Republican centrists and independent voters.
McCain may lack the eloquence and glamour of Obama, but he has a compelling biography in an era of terrorism and war: A US Navy fighter pilot, he narrowly missed death in an explosion on the US Navy aircraft carrier Forrestal in July 1967 and was shot down on October 26, 1967 over North Vietnam, breaking both arms and a leg.
He spent five and a half years as a prisoner of war in Hanoi, where he was denied medical treatment, tortured and kept largely in solitary confinement.
McCain's father and grandfather were four-star admirals in the US Navy. In fact, his father was a top US commander in the Vietnam War. When his captors discovered this, they provided him some medical care. But McCain refused North Vietnamese offers of early release, insisting on waiting until comrades who had been held longer were freed.
The experience left McCain with permanent disabilities - he cannot raise his hands above his shoulders. At rallies, he waves to supporters by holding his arms in front of his body instead of over his head.
His face betrays the impact of a skin cancer operation in 2000, which has left a scar running down his neck and a puffy left cheek. He has had four melanomas, on his left shoulder, upper left arm, nose and the most serious one on his temple.
'I'm older than dirt and I have more scars than Frankenstein,' is a common McCain response to queries about his age and health.
His experiences give him a strong advantage among older voters in the rapidly-aging US population who worry about Obama's short four- year Senate career and lack of military experience. As the two candidates court a deeply conservative country, McCain is banking on a last-minute transformation that would bring him the long-sought White House.
Born on August 29, 1936 in Panama, the elderly senator has had to convince voters that he is fit enough for the country's top job.
After his return to the US as a war hero, he continued to serve, ultimately acting as naval liaison to the Senate until his retirement in 1981. He then moved to Arizona and kicked off his political career, winning a congressional seat in 1982 and a Senate seat four years later.
There were also changes in his personal life. His marriage to first wife Carol, a model from Philadelphia who was in a devastating car accident during McCain's captivity, fell apart from the strain of the war-time separation and later, as he admitted, by his extramarital affairs. They had one child, and he adopted Carol's two sons from a previous marriage.
'Sound marriages can be hard to recover after great time and distance have separated a husband and wife,' McCain wrote in his memoir Worth the Fighting For. 'But my marriage's collapse was attributable to my own selfishness and immaturity more than it was to Vietnam.'
In 1979, still married, McCain met his current wife Cindy, an ex- cheerleader, rodeo queen and heiress to a beer distribution business, at a military reception in Hawaii. He was 43, she was 25 and they both initially misled each other about their ages.
They had three children. A fourth came in 1991, when they adopted an abandoned Bangladeshi baby, who would later become the focus of a vicious telephone campaign in 2000 by supporters of Bush, who beat McCain in that year's presidential primary contest. The McCain campaign's use this year of equally harsh robo-calls that attempted to label Obama a terrorist have brought condemnation from within his own party.
While McCain's detractors call him erratic, unpredictable and out of touch with the needs of Americans, his supporters acknowledge that he isn't a smooth campaigner, but say he will make a good president.
Your Talkback on this Story