By Steve Schifferes
In just two months John McCain has gone from has-been to dominant front-runner in the Republican race for the White House. How did he do it?
John McCain was an early front-runner in the Republican campaign to gain the presidential nomination, but his campaign had stalled by the summer of 2007.
Lack of funds forced him to drastically trim his campaign staff and close his offices in many states.
It looked like a replay of 2000, when Mr McCain was defeated by the well-financed Bush campaign after an early victory in New Hampshire.
But at age 71, Mr McCain knew this would be his last chance to run for president.
New Hampshire gamble
So he decided to gamble everything on the New Hampshire primary, where his maverick Republican views would be less unpopular and independent voters, who were among his strongest supporters, would have a chance to vote.
On 17 November, the Senator's campaign bus, the "Straight Talk Express", rolled up in a snowstorm to Dixville Notch, a small town on the northern border with Vermont and Canada for a town meeting attended by a few dozen supporters.
His bus also stopped at restaurants, diners and coffee shops along the way.
It was the first of 100 town meetings that the Senator would hold up and down the state until voting took place in early January.
Mr McCain's personal, straight-talking approach went down well in New Hampshire, and his town meetings grew in size.
He was also helped by some key endorsements, including from the state's leading newspaper, the Manchester Union Leader, which has a conservative viewpoint, and from Senator Joe Lieberman, the pro-war Democrat who had won re-election in nearby Connecticut in 2006 as an independent.
But as late as 9 December, Mr McCain was still only supported by 12% of Republicans in a national ABC News/Washington Post poll.
To keep his campaign going, Mr McCain had to rely on many of his key aides working for free, and a group of volunteer fundraisers to appeal for cash.
His internet fundraising director, Rebecca Donatelli, said: "We were down to nobody. To nothing. But somehow it was OK because Senator McCain was in the room."
But Mr McCain managed to secure a $3m loan from his local bank in Washington, Fidelity Trust, secured against future campaign revenues.
New Hampshire invigorated John McCain's presidential hopes
According to newspaper reports, the bank also took out an insurance policy against his life to make sure they would be repaid if he did not survive the campaign.
The money was vital to pay for a burst of late advertising in the expensive media market of Boston, which reaches southern New Hampshire, and to help get out his vote.
Mr McCain's upset victory over Mitt Romney, the favourite son from the adjoining state of Massachusetts, gave his campaign crucial momentum - and restored its financial health.
The next stage in Mr McCain's unlikely comeback was his victories in two Republican primaries in the South, not his natural territory. They included Florida, the fourth-largest state in the US and much more typical of the electorate as a whole.
Mr McCain was helped by mistakes and divisions among his Republican opponents, with former Baptist minister Mike Huckabee splitting the vote among Christian evangelicals in South Carolina.
In Florida, Mr McCain gained support among military veterans, older voters, and the disillusioned supporters of former New York Mayor Rudi Giuliani, who frittered away $60m in campaign funds without making much of an impact.
And he gained crucial support from Hispanic voters who were angry about Mr Romney's hardline views on illegal immigration.
In Florida he was leading not just on character but also on the issues, including the economy.
But Mr McCain was still running weakly among traditional Republican voters.
Even Mr McCain's own mother said that many Republicans would have to "hold their noses" and vote for him.
But despite Mr McCain's sweeping victories outside the South on Super Tuesday, there is still a strong ideological divide among Republican voters - with moderates and independents supporting him much more strongly than conservatives.
He was strongest in states which normally vote for Democrats, such as California, where he was helped by the endorsements by other prominent members of his party, such as California governor Arnold Schwarzenegger and Mr Giuliani.
But Mr McCain still inspires less enthusiasm among activists in his own party than his Democratic rivals do among supporters in theirs.
And many in his party believe he does not share their core Republican values.
His challenge as his campaign goes forward will be to maintain his appeal to the independent voters who could be crucial in November, while mobilising the traditional Republican base to come out and vote.