Local BJP leader Ajay Diwakar conducted a magic show

A BJP rally in Rampur in western Uttar Pradesh on Thursday evening held an unusual sight even by the standards of political campaigns in the state - an hour-long magic show put together by local politician Ajay Diwakar for the benefit of Bharat Bhushan Gupta, the party candidate in a crucial bye election for the Rampur Assembly seat. The BJP's theatrical campaign style comes after Samajwadi Party leader Azam Khan, who is a nine-time MLA from Rampur, resorted to theatrics himself, breaking down at a rally on Tuesday after complaining that he had been accused of stealing hens and goats.

On Thursday, in a video shot by journalists, Mr Diwakar, whose day job is that of a BJP Councillor in the local municipality, can be seen striding around the stage dressed in a saffron jacket and enthusiastically displaying Congress and Samajwadi Party flags to a bemused audience. A few grand gestures later and hey presto... they were turned into a BJP flag to loud cheers from a 1,000-strong audience.

However, it will take the BJP more than a few magic tricks to wrest Rampur - a seat it has never won - from the Samajwadi Party. The seat fell vacant after Azam Khan won the Rampur parliamentary seat in Lok Sabha polls in April-May. The better news for the BJP is that they seem to be better placed in most of the 10 other seats that will see bye elections on Monday.

#WATCH BJP leader Ajay Diwakar demonstrates trick to combine flags of three political parties into one BJP flag, during campaigning in Rampur for upcoming by-elections. (16.10) pic.twitter.com/xiZb09mX6W — ANI UP (@ANINewsUP) October 17, 2019

Back to Rampur where, magic tricks and disappearing hens and goats aside, the background to this bypoll is full of acrimony.

Over the past few months UP Police have filed as many as 84 cases against Azam Khan, with allegations ranging from land grab and encroachment to the theft of farm animals. On Tuesday the veteran politician claimed he had been targeted "because I have neither sold you (the people of Rampur) nor myself".

Azam Khan's wife, Tanzeem Fatima, who has been fielded by the Samajwadi Party as its candidate for this election, and his son, Abdullah Azam Khan, who is the MLA for another seat from Rampur, have also been booked.

The nine-time MLA has not yet been arrested though, with the Allahabad High Court last month staying his arrest in 29 of those 84 cases.

Samajwadi Party MP Azam Khan is a nine-time MLA

All of this has not deterred Mr Khan, 71, from attempting to wield his not inconsiderable influence in the region. With his wife and son by his side, it is the veteran politician who has done most of the talking at rallies in the state.

"Those who are making accusations against me... I ask them - why will I usurp the land of the poor? At least be scared of Allah before making such false allegations," Mr Khan said at a rally in Rampur, where more than half - about 60 per cent - of the electorate are Muslims.

In fact, Mr Khan has even convinced party chief Akhilesh Yadav to reluctantly campaign in Rampur. The former Chief Minister, who has yet to campaign for these bypolls, is scheduled to address a gathering on Saturday, the last day of campaigning.

Does this mean the BJP is (still) on the back foot in Rampur?

The party, which stormed to victory in 64 of 80 Lok Sabha seats in the state earlier this year, is banking on magic - not just the kind that changes Congress flags into BJP, but that of Chief Minister Yogi Adityanath, who is scheduled to host a rally in Rampur today.

The BJP are also relying on a third kind of magic - that of actor-turned-politician Jaya Prada, who lost the Lok Sabha election to Azam Khan. A former protege of the Samajwadi Party leader, she has been a near-constant presence in Rampur since.

The two share a controversial past with Azam Khan accused of making sexist and derogatory remarks against Jaya Prada when she was a Samajwadi Party member.

"We cannot let this town slip into darkness further. I could not defeat Azam Khan sahab in Lok Sabha polls but this is your chance to correct that mistake," Jaya Prada said at a rally in town on Thursday.