The Supreme Court Friday directed the Punjab government to hand over the custody of gangster-turned-politician Mukhtar Ansari, who is lodged in Rupnagar jail there, to Uttar Pradesh Police, saying the custody was being denied on trivial grounds under guise of medical issues.