Khalid was shot at when he was returning from Meerut court hearing at Meerapur town in the district, they said.
"He was rushed to Meerut medical in serious condition," Deputy SP Mukesh Mishra told PTI.
Khalid was lodged in Bijnor jail since 2013 in three cases of murder and loot.
Police have launched a combing operation to nab the assailants, Mishra said.
Meanwhile, three of a family, including a five-month-old infant, were crushed to death by a speeding vehicle on Muzaffarnagar-Shahpur road near Tawli village in the district today.