Amit Shah, president of the Bharatiya Janata Party (BJP), repeated what he did in the Lok Sabha elections: A clean sweep in Uttar Pradesh. He had pulled off an electoral coup in 2014 when the BJP won 71 of the 80 Lok Sabha seats, enabling the party to get a clear majority in the Lok Sabha.

Almost three years later, the party has done it once again under his leadership, winning 310 seats, surpassing the most optimistic prediction that gave the party 285 seats in the 403-member Assembly.

The BJP got 39.7 percent of the votes cast, far ahead of its nearest rival Bahujan Samajwadi Party, or BSP (22.2 percent) and Samajwadi Party, or SP (21.8 percent), according to the ECI.

How did the party manage such a spectacular victory, winning even in Muslim-dominated constituencies despite not fielding even a single Muslim candidate?

It's deft political management at the booth level, involving 13.50 lakh party workers who manned 147,000 polling booths, according to a report by the Hindu. The party's focus on constituencies where candidates tend to lose or win by a wafer-thin margin also paid off.

"We refused to give up on them, and we now find that we have won 60 out of those 70 seats," the newspaper quoted a senior party office-bearer as saying.

Congratulations to @AmitShah, party office bearers & state units for their exemplary work in taking the party to new heights.

Another reason was smart selection of candidates, keeping the caste dynamics of the population in mind.

"Non-Yadav OBCs got as many as 150 ticket out of a total of 381 seats fought by the BJP. Among the 85 seats reserved for Scheduled Castes in the Assembly, we gave 64 tickets to non-Jatav Dalits. The message was clear, when it came to OBCs and EBCs, we were the party that gave hissedaari [a share]," the daily said, quoting a party source.

The clean sweep meant that the traditional tactic of the Congress, the Samajwadi Party and the Bahujan Samaj Party (BSP) exhorting Muslims not to vote for the BJP failed to work yet again.

The impact of the results in Muslim-dominated prompted BSP chief Mayawati to actually say this: "Muslims votes have gone to the saffron party which is unacceptable." For long, the three parties had considered such seats as their strongholds. But 2017 proved them wrong.

In the six constituencies of riot-hit Muzaffarnagar district — Budhana, Charthawal, Purqazi, Khatauli, Meerapur and Muzzafarnagar — the BJP won all, proving that not fielding Muslim candidates in such constituencies was not a negative factor. Similarly, the party defeated its rivals in Bijnor, Bareilly, Moradabad (Urban) where the demographics are not considered in favour of the BJP.

A training programme launched for unemployed youth did it for the BJP in eastern Uttar Pradesh, where Muslims are in sizeable in some constituencies such as Mirzapur. The party won all the three seats in Varanasi — South, North and Cantt — in addition to Mirzapur.

However, the SP won in Azamgarh, another constituency where Muslims are in sizeable numbers.