Sadiq Khan is a more formidable politician than I realised before writing this profile. He possesses a remarkable ability to understand what an audience wants to hear, and an almost unbounded willingness to say it.

On 5th May he could become Mayor of London. The bookies and the opinion polls put him ahead of Zac Goldsmith, and astute observers such as James Kirkup of the Daily Telegraph predict victory for Khan.

How has this hitherto obscure figure, whose parents were immigrants from Pakistan, managed to place himself within striking distance of becoming the Labour politician with the largest personal mandate in the country? He has benefited from being underestimated by his opponents.

Tessa Jowell’s supporters were confident she would beat Khan, who to them appeared an insignificant little man, quite unable to compete with her high-profile record of helping to deliver the London Olympics. Yet in September last year, Khan, who had stronger trade union support, trounced her by 59 to 41 per cent in the final round of voting.

Internal Labour elections are not won by being seen, like Jowell, as the Blairite candidate: a truth confirmed the following day when Jeremy Corbyn was elected party leader. Khan was one of the MPs who had put Corbyn on the ballot paper, so was naturally regarded as Corbyn’s man.

This was a reputation which Khan, having won the mayoral candidacy, had no desire to be lumbered with. So at the first opportunity he gave an interview to Simon Walters, of the Mail on Sunday, which appeared under the headline “Labour’s ‘Mayor’ savages Corbyn”.

Here was no gentle attempt to place a modest distance between himself and the new Labour leader. Khan condemned Corbyn for refusing to sing the National Anthem:

“He was very unwise. You are trying to be the British Prime Minister: you should be singing the National Anthem. It was a mistake, especially on that occasion. You have to show respect.”

To demonstrate his own respect for the Queen, Khan described in tones of rapture how he had gone down on one knee before her and kissed her hand on becoming a privy counsellor. He also recalled family day trips to Buckingham Palace, and supplied a photograph of himself as a child during the celebrations of the Silver Jubilee in 1977.

And Khan widened his attack to include Corbyn’s ally, John McDonnell. As Walters reported:

“He said McDonnell’s claim that IRA killers should be ‘honoured’ could encourage terrorism in London, and Corbyn’s support for Arab extremist groups could inspire anti-Semitic attacks.”

Corbyn’s activists will be working hard for Khan in the mayoral election: they know that victory in London would strengthen their position, while defeat would be disastrous. But the frequency and severity of Khan’s attacks on Corbyn make it difficult to dismiss him as an unthinking follower of the present Labour leader. It would be more accurate to describe him as a protégé of the last Labour leader.

For Khan was an early supporter of Ed Miliband’s leadership bid in 2010, acted as his campaign manager, and participated with enthusiasm in the denunciation of Peter Mandelson: a ploy which enabled the younger Miliband to cut himself free from New Labour and become – as Khan urged – “the change candidate”. Meanwhile David Miliband found himself unable to separate himself from Labour’s Blairite past.

Once Ed Miliband had won, being against Mandelson turned out to be an insufficient basis on which to build a relationship with the British people. Khan, however, was richly rewarded: he became shadow Justice Secretary, shadow Minister for London, and Miliband’s London election strategy man.

He could scarcely have had a more favourable opportunity to line himself up, with Miliband’s help, for a crack at the mayoralty in 2016, when Boris Johnson steps down. The 2015 general election turned out to be a disaster for Miliband, but in London, Labour did well, gaining seven seats, which took its total to 45 out of 73 constituencies, and winning 1.55 million votes to the Tories’ 1.23 million.

Khan had himself helped a number of Labour women from ethnic minorities to find seats. Although this is now changing, Labour has in recent decades done more than the Conservatives to integrate migrants and their children into political life.

But for Khan, speaking out against Corbyn no more constitutes a programme than speaking out against Mandelson served as one for Miliband. If anything, that kind of attack-dog behaviour is more of a hindrance than a help when it comes to framing a public appeal.

Something more substantial and constructive was needed. He set out to tell his own story in terms which would have a wider resonance.

His parents emigrated from Pakistan to London shortly before he was born in 1970, and his grandparents on both sides were born in India. He grew up with six brothers and a sister in a council flat in south London, and wrote the other day, in a piece attacking the Government’s Housing Bill in the Daily Mirror, illustrated by a charming family photograph of Sadiq and two of his brothers in identical check shirts:

“My family were able to fulfil our potential because of the security of our social home. My parents could bring us up in a safe and secure environment, while they worked every hour to save for a deposit.”

For the Khans, the welfare state was an aid to aspiration, not a way of sitting around doing nothing. His parents wanted him to be a dentist, but he read law at the University of North London, after which he qualified as a solicitor and set up a law firm with Louise Christian, specialising in human rights.

Politics attracted him from an early age: he joined Labour at the age of 15, served as a councillor in Tooting from 1994-2006, became Labour’s parliamentary candidate in that part of south London for the 2005 general election, and has sat since then as MP for Tooting, which he last year held by 2,842 votes. In a recent speech to the Union of Jewish Students he said:

“My dad worked as a bus driver and my mum sewing clothes. And that work ethic that was necessary for them to pull themselves out of poverty leaves a deep impression for generations. It’s something British Muslims and British Jews share. I’m amazed at some of the stories I’ve heard from people like Parry Mitchell, Michael Levy and Gerald Ronson who I’ve had the pleasure to befriend. People who in a single lifetime have pulled themselves out of absolute and total poverty – literally living in slums in East London – to becoming so incredibly successful.”

This glorification of hard work, self-reliance and success might equally well have been uttered by a slightly cloth-eared Conservative. In an interview with James Forsyth, political editor of the Spectator, published earlier this month, Khan went even further:

“‘I want Spectator readers to give me a second look,’ he says, when we meet in the House of Commons… He’s keen to ladle praise on Boris Johnson — a ‘great salesman for our city’ who made him feel ‘proud to be a Londoner’ during the Olympics. He even likes rich people. ‘I welcome the fact that we have got 140-plus billionaires in London; that’s a good thing. I welcome the fact that there are more than 400,000 millionaires; that’s a good thing.’ If you shut your eyes, it could be Peter Mandelson speaking. It is not what you would expect from someone who has always been on the soft left of Labour.”

It strikes me that Khan’s eagerness to please could get out of hand. His readiness to lay it on with a trowel places him back on the same side as his old antagonist, Mandelson. Khan is full of new-found enthusiasms. As a candidate, he is pro-everything: unions, business, the poor, the rich.

He has promised, if elected, to freeze transport fares in London for four years, and claims, implausibly, that this will do no harm. His promise is, however, undoubtedly something that many low-paid Londoners want to hear.

Boris Johnson has attacked Khan for refusing to condemn the latest wave of London Underground strikes, and says of him: “He is a tool of ASLEF. He emanates from the bowels of the unions.”

Dan Watkins, his Conservative adversary in the Tooting seat, says of Khan: “He doesn’t seem to enjoy the scrutiny and accountability of hustings.”

It is in public debate that Goldsmith may be able, during the campaign, to demonstrate the incompatibility of Khan’s various positions, and the flagrant opportunism with which these are sometimes taken up. On SadiqWatch.com, the Conservatives are already trying to do this.

But Khan did also attempt, soon after getting into Parliament, to set out some thoughts about living as a Muslim in this country, and about how to respond to the terrorist attacks on London which had occurred two months after the 2005 general election. His thinking was summarised in his Fabian Society pamphlet of 2008, Fairness not Favours: How to reconnect with British Muslims.

Although he disclaimed any desire to set himself up “as a Muslim spokesperson or community leader”, he saw he could hardly avoid the subject, even if he wished to, and that there was a demand for an account of his faith which made it sound, or urged it to become, as unthreatening as the Church of England. In an accompanying article, he sought to summarise one of the points he was trying to make:

“I challenge British Muslims to accept that as strongly as they feel about Iraq or counter-terrorism measures, poverty and inequality have the biggest impact on the lives of the majority of British Muslims and do the most to prevent potential being fulfilled.”

It is a thoroughly integrationist line of thought, and in his attempt to become Mayor of London, one could say that Khan is practising what preaches.