Ansari, against whom the anti-corruption court had issued non-bailable warrants, surrendered before Judge Pawan Dev Kotwal.
After hearing both the sides, the judge said he does not find any ground to withhold bail of the accused.
Ansari was granted bail after furnishing personal bond of Rs 50,000.
The court had on May 15 issued non-bailabale warrants against Ansari for securing his presence in court in the multi-crore township scam case.
J&K Governor Lt Gen S K Sinha had given nod for prosecution of Ansari in the case. Ansari, who was the Housing and Urban Development Minister in Farooq Abdullah government 1997, was indicted by a one man Commission headed by then Vigilance Commissioner R V Raju who probed the alleged scam.
The Commission in its report submitted to the government indicted Ansari, who was tasked to setup up a Rs 500-crore satellite township at Sidhra in the outskirts of Jammu city in 1997, of taking Rs 60.25 lakh in kickbacks from Infrastructure Projects Private Limited (IPPL), New Delhi.