By Brian Wheeler
BBC News politics reporter
David Cameron might be forgiven for feeling a touch of vertigo at the moment.
A few short months ago, the new Conservative leader was virtually unknown outside Westminster.
He had been an MP for just four years and had only recently been promoted to a leading frontbench job, shadowing Education Secretary Ruth Kelly.
Although he has played a leading role behind the scenes of Tory politics for years, Mr Cameron was not yet a familiar face on television and in the newspapers.
His rise to prominence has been meteoric. Dizzying even.
Even William Hague, who was younger than Mr Cameron when he became Tory leader, had been an MP for eight years and had sat in the Cabinet as Welsh Secretary before he landed the top job.
Tony Blair - the politician with whom Mr Cameron is most often compared - had been an MP for 11 years when he became Labour leader, and had proved himself in a succession of front bench roles.
So how did he do it?
There is no doubt the Cameron campaign has been a slick one.
No more than you would expect, perhaps, from a former head of public relations at a commercial TV station.
Mr Cameron is very well-connected within the Tory party hierarchy and the media, a leading member of the so-called Notting Hill set, the group of smart young Tories gathered around Michael Howard.
He was Mr Howard's right-hand man ahead of the general election, writing the party's manifesto and devising key policies.
Mr Cameron's friends in the media include Daily Telegraph journalist Alice Thompson and Henley MP and Spectator editor Boris Johnson. Times journalist Michael Gove and Guardian columnist Ed Vaizey, both newly elected MPs, were key members of his campaign team, as was advertising guru Steve Hilton.
But having friends in high places is no guarantee of political success and when Mr Cameron first hinted in the summer that he wanted to lead the party, few outside his immediate circle thought he stood a chance.
Up against party "big beasts" such as Ken Clarke and Sir Malcolm Rifkind - or the acknowledged frontrunner David Davis - Mr Cameron appeared inexperienced and lacking in support.
And, initially, his campaign appeared to be flatlining, as he struggled to pick up backing from MPs outside his coterie.
Some commentators felt the 39-year-old was merely putting down a marker for a future leadership bid.
It was only at his official campaign launch, at the end of September, that there was the first inkling that a new star might be emerging in the Tory firmament.
David Davis launched his campaign on the same day and journalists who went to both events returned with tales of Cameron outshining his older rival.
"Cameron's was an altogether more modern, even chic, affair. They even served fruit smoothies to journalists on the way in," said BBC Radio 5 Live's John Pienaar.
"The room resembled an upmarket cafe-bar, and Mr Cameron played the part of the young man with fresh ideas: a candidate with a vision, not just of a changed party but a new one."
But it was the following week's party conference in Blackpool that proved to be the real turning point.
The "beauty contest" format, devised by Mr Howard and party chairman Francis Maude, in which each of the candidates was given 20 minutes to make a pitch to the party faithful, could have been designed with Mr Cameron in mind.
It was not so much what Mr Cameron said - there was little in the way of policy detail in the speech - but the way he said it, roaming the stage, speaking without notes.
Sir Malcolm Rifkind - the first of the contenders to take to the stage - had pulled off a similar trick two days earlier.
But the youthful Mr Cameron, with his talk of "turning on a new generation" to the Conservatives, seemed like the man for the future, rather than a face from the past.
Unlike his closest rivals Mr Davis and Mr Clarke, who had been rooted to the lectern, fumbling with glasses of water and notes, Mr Cameron strode the stage, exuding passion and youthful vigour.
At the end of the speech, he was joined on stage by his pregnant wife Samantha - enjoying her first trip to a party conference - in what looked like a conscious attempt to emulate Tony and Cherie Blair.
Mr Cameron reportedly told a dinner for newspaper executives he was the "heir to Blair".
He was starting to look like a winner - an impression confirmed by glowing press reviews of his big speech.
Mr Davis's speech, by contrast, was judged to have been lacklustre and poorly received in the hall.
The Cameron campaign was able to return to Westminster with the wind in its sails, boasting a clutch of new converts and evidence, from a polling exercise conducted by the BBC's Newsnight, that their man was by for the most popular candidate with younger voters.
But Mr Davis still had by far the biggest number of declared supporters among MPs, who would decide which of the contenders would go forward to face a members' vote.
Conference also saw the emergence of an issue that threatened to torpedo the Cameron campaign just as it was starting to take off.
Asked at a fringe meeting if he had ever taken drugs, Mr Cameron dodged the issue, joking about having a normal student experience.
His refusal over the next few days to answer questions about drugs, saying he was entitled to a private life before politics, inevitably fuelled a media witch hunt, which culminated in a News of The World front page story.
The paper published a 12-year-old picture of Mr Cameron's campaign manager George Osborne with a former "vice girl", at a party where drugs were allegedly taken.
It was hardly the knockout blow Mr Cameron's opponents might have been hoping for.
And by sticking to his guns and continuing to dodge the drugs question Mr Cameron managed to appear resolute and calm under fire.
His supporters could talk about him weathering his first "trial by media" and, crucially, the polls showed it had done him no real damage with voters.
He was steadily gathering support among MPs and came a close second to Mr Davis in the first ballot, before winning the second one with 90 of a possible 198 votes. Mr Davis gained 57 votes - a significant drop in support from the 100 or more claimed at the party conference, but enough for the Davis campaign to believe they could turn it around in the members' vote.
Both men kicked off their campaigns with an attempt to appeal to the youth vote, with Mr Davis appearing on a student radio station and Mr Cameron telling listeners at a London community radio station to "keep it real".
But it was Mr Cameron who grabbed the headlines when he was accosted by a man in the street, who gave him a bear hug and told him "we have all been bad boys".
It was the sort of unscripted, spontaneous encounter politicians hate, but Mr Cameron emerged from it relatively unscathed.
Over the next few weeks, the two Davids toured the country for a series of party hustings, which were closed to the media.
They also met in three hour long televised debates on BBC, ITV and Sky, which were, for the most part, remarkably cordial encounters, with both men appearing anxious not to engage in mud-slinging.
Real differences in the two campaigns were evident from the start.
'Punch and Judy'
Mr Davis went for substance, unveiling a series of detailed policy proposals, including a bold pledge to cut £1,200 from the average family's tax bill.
The Cameron team deliberately held off from talking about policy, concentrating instead on the need to reform the party and bring in more women candidates and people from ethnic minorities.
Mr Cameron spoke in positive, upbeat terms about the future of the country and of his distaste for "Punch and Judy" politics, saying he would support Tony Blair on certain issues.
He dismissed questions about his privileged background and alleged drug use in a series of well-rehearsed soundbites.
His strategy was to project himself as the man most likely to appeal to younger voters and win back support from people who had switched to Labour.
Reaction from the party faithful to the hustings and televised debates was mixed, with no clear winner emerging.
But it seemed the momentum Mr Cameron generated at the party conference - and his confident performances in one-to-one television interviews - were enough to convince party members they had a winner on their hands.