Ansari, an MLA from Uttar Pradesh's Mau constituency, is currently lodged in Banda jail of the state.
A local court on Saturday rejected a bail plea of mafia-turned politician Mukhtar Ansari in connection with a 2020 land grab case.
The action was taken in accordance with the provisions of the Gangsters Act under which Mukhtar Ansari has been booked.
Special Chief Judicial Magistrate Ambrish Kumar Srivastava said that there are as many as 56 cases lodged against Mukhtar Ansari.
A bench of Justices Sunita Agarwal and Vikas Kunvar Srivastav ordered that the petitioner, Abbas Ansari, shall not be arrested till April 27 and he will be under obligation to cooperate.
The seventh and last phase of the polls to the 403-member state assembly will be held on March 7.
Mukhtar Ansari's son threatens to 'settle account' with government officials after UP polls, FIR lodged
Abbas Ansari is contesting the Uttar Pradesh Assembly polls from Mau on the ticket of the Suheldev Bharatiya Samaj Party (SBSP), which has a tie-up with the Samajwadi Party.
Union Home Minister Amit Shah and other BJP leaders have been taking Mukhtar Ansari's name to attack the Samajwadi Party on the issue of law and order.
Special Judge Dinesh Kumar Chaurasia allowed the bail to Ansari, who is lodged in Banda jail, on a surety of Rs 1 lakh.
The SBSP, which had contested the 2017 assembly elections in alliance with the BJP, has four MLAs at present.
The plea filed by Mukhtar's sons Abbas Ansari and Umar Ansari was dismissed by the high court's Lucknow bench of justices Ramesh Sinha and Saroj Yadav.
Mukhtar Ansari, according to his lawyer Randhir Singh Suman, made the request during a hearing through video-conferencing.
The All India Majlis-e-Ittehad-ul-Muslimeen's (AIMIM) national spokesperson Syed Asim Waqar said the party's doors are open for Ansari.
Mayawati said BSP state president Bhim Rajbhar will contest from Mau seat, currently represented by Mukhtar Ansari who is lodged in a jail in Banda, with several criminal cases pending against him.
SC refuses to interfere, declines to pass order over Mukhtar Ansari's wife plea seeking his safety in jail
Earlier on Thursday, Mukhtar's wife Afshan and son Umar Ansari have filed an application in the Special Court in Prayagraj stating that Mukhtar's life is in danger inside the jail.