You don't get a lot of groupies at election counts – especially not grown men waiting for hours in the cold for a middle-aged politician to emerge from a municipal leisure centre. But the Bradford West byelection wasn't an ordinary election and the man who won it by a landslide was a far-from-ordinary man.

"This man will represent the views of the ordinary people here. He will address corruption and impotence in Bradford – cynics, thieves, robbers like you get in cowboy films," said one typically exuberant supporter. He had joined 100 or so others outside the Richard Dunn sports centre at midnight after word spread that George Galloway might just pull off the mother of all coups and win a seat the Labour party had held comfortably since 1974.

But just after 2am on Friday morning came the result Labour had been quietly dreading: Galloway had done it, and by no small margin. The Respect politician had demolished the Labour vote, winning a 10,140 majority. More than 18,000 people in Bradford West put a cross next to his name, more or less the same number who voted for the incumbent, Marsha Singh, in the last general election. It was Singh's ill health that triggered the rushed poll.

When Galloway eventually emerged from the sports centre, his supporters carried him aloft like a football captain who had taken his team to an FA Cup triumph. "RE-SPECT! RE-SPECT!" chanted his patient fans, adding, "George for prime minister" He was then driven into town in a Hummer – the armoured car favoured by Arnold Schwarzenegger when he was governor of California – where hundreds of supporters had been waiting for him since polls closed at 10pm. Car horns honked to celebrate his arrival at the campaign HQ in Grattan Road, and Galloway climbed on top of a grey car and was handed a megaphone to preach to the assembled faithful. "All praise to Allah," he yelled, to jubilant cries of "Allah, Allah".

When Galloway's victory was confirmed, political pundits lined up to declare their astonishment at his shock triumph. It was so widely acknowledged that Labour would hold the seat that lobby correspondents had been briefed that Ed Miliband was due to swoop into the constituency on Friday morning. Very few people predicted that Galloway could repeat the trick he pulled off in Bethnal Green and Bow in London in 2005, when he overturned a 10,000 Labour majority standing for the first time on the Respect ticket.

But you didn't need to spend long on the campaign trail with Galloway to realise that a win for him in this multicultural constituency was not beyond the bounds of possibility. The Guardian followed him for few hours last week as he toured the Bradford University campus and it was like being in the retinue of a Hollywood star. Every step he took, someone called out his first name and went in for a hug or asked to have their photo taken. The Guardian's photographer, a veteran of 25 years of covering byelections, said he had never seen anything like it.

The majority of those pledging their support had a number of things in common. They were either a first time voter or a disaffected Labourite, and all wanted to congratulate him on his robust stance against the wars in Afghanistan and Iraq. Many said they used to watch him on Press TV, the English-language Iranian controlled channel – until it was taken off air by the government earlier this year.

More still had watched YouTube clips of Galloway ripping into his detractors, whether in front of the US senate in 2005 or in a classically adversarial interview with Sky News about Gaza. These, Galloway proudly refers to as his "greatest hits". Only a handful recognised him primarily from his appearance on Celebrity Big Brother in 2006, when he dressed in a red unitard and pretended to be Rula Lenska's pussycat.

A common theme was frustration at clan politics in Bradford, known by the Urdu word Bradree, meaning relation or family, which here has become a byword for exclusivity. Many felt that too many important decisions were taken in Bradford by a small number of Pakistanis who came from Mirpur, a small town in Kashmir, and who had carved up the most important Labour party positions between them over the years.

The Labour candidate in the byelection seemed to many to fit exactly into that mould. Imran Hussain, a 34-year-old barrister from Bradford with Mirpur heritage, was following in his father's footsteps when he became involved in the local Labour party, rising two years ago to become deputy leader of the city council. When the Guardian joined him on the stump in the Allerton ward last week, the contrast between the reception he received and the way Galloway was hailed on the university campus could not have been starker. Hussain didn't appear to be converting any voters but was instead preaching to the converted: those who had voted Labour all their lives and always would.

Galloway, meanwhile, was unleashing all the charm in his substantial armoury to win the hearts and minds of Bradford, lavishing particular care and attention on the younger voters, especially those who had never bothered going to the ballot before. Outside the count on Thursday night, dozens of men said they had voted for the first time that day. "I've never voted in my life – I'm 32. I didn't believe in 'em. They're just after the cheque. They just want the cash. End of," said one, as his friends yelled, "He didn't know how to vote" and "He didn't even know whether to put a cross or a tick." The man nodded. "It's true. But George said, here you go, number 2 [on the ballot paper]."

While Galloway turned up to every hustings, guns blazing, his Labour counterpart shied away. The Labour spin machine swore blind it was because they felt Hussain could shore up support better wearing out his shoe leather on the streets of Bradford. But, like almost anyone else in the world, their man, far from your typically silver-tongued barrister, would be no match for Galloway in a debate. The one time the two did meet, on the Sunday Politics show , Galloway wiped the floor with his opponents. "Do you want a local councillor, or an MP?" he asked.

The 57-year-old repeatedly denied he was a divisive figure stirring up racial and religious tensions. "It was Labour who put up a Pakistani Muslim candidate, not us," he told reporters after his victory. But he clearly played to the 38% of Muslims who made up the constituency at the last count (the 2001 census).

Furqan Naeem, senior Labour Student member and the chair of University of Bradford Student Union Council, said at the count: "George has captured the hearts and minds of the young students – especially people from Asian backgrounds who were previously not political. They have become the driving force of his campaign."

"He has visited the campus a number of times. The reason is that he resonates with young people on certain issues. They don't understand what's going on but they see George as a figure who voted against the Iraq war and he is big on Palestine, which a lot of Asian people care about. They see a man of principle there – although personally I think he has been very opportunistic. It's not that he doesn't have a right to come here, but he has never done anything for Bradford before – he just sensed an opportunity to win a seat."

Galloway told anyone who dared suggest such he opportunistically targeted Muslims that they were being racist, or at least discriminatory. "To suggest all Muslims vote for me is to suggest they are second-class citizens who vote like herds of sheep," he said.

But he never held back on the religious imagery. Reflecting on his victory in the early hours of Friday morning, he said we had witnessed something "miraculous" in the biblical sense of the word. "And as a religious man, I have to believe that there is some divine intervention in this – the retribution of the main parties for the treason against the country and against their supporters that they have visited is something sacred. Justice has been done."