Delhi's Patiala House Court granted bail to CBI DSP Devender Kumar on furnishing of a personal bond of Rs 50,000 and one surety in the like amount.
Earlier the court had reserved its verdict on the bail plea of Kumar, who was arrested in connection with bribery allegations involving the agency's Special Director Rakesh Asthana
Special CBI Judge Santosh Snehi Mann had said he would pass order later during the day after both sides complete their arguments.
During the hearing, the lawyer appearing for Kumar had told the court that every rule has been violated by CBI in this case against him and the "irony" is that the person who followed the rule is in jail.
The CBI did not oppose his bail petition.
In his bail application, Kumar had termed his custody "illegal" and urged the court to set him free.
The application also said Kumar was ready to abide by the conditions imposed by the court while granting him bail.
It claimed that the Central Bureau of Investigation (CBI) sleuths did not have valid search warrants when they raided Kumar's office and residence.
His eight mobile phones, an iPad and his son's laptop were seized, the plea said, seeking a direction to the agency to release these articles.
Kumar and Asthana have already challenged the legality of the FIR filed against them.
Besides them, two alleged middlemen -- Manoj Prasad and Somesh Prasad -- have also been named as accused in the case.
The agency had earlier told the court that Kumar had tried to fabricate evidence during the investigation in another case.
Kumar had claimed that he was falsely implicated in the case and that he was a victim of rivalry among the senior officers of the central probe agency.
He had said he was investigating a case against meat exporter Moin Qureshi, in which the complainant in the present case -- Sathish Babu Sana -- was a suspect and the names of some past and present senior CBI officers had surfaced.
Kumar had claimed that his arrest in the present case was motivated to stall the investigation in the case against Qureshi and that there was no direct allegation against him.
If convicted, the accused may get a maximum 10-year jail term in the case.
The FIR in the current case was lodged on the basis of a written complaint from Sana on October 15, wherein it was alleged that Kumar, being the IO in the case against Qureshi, was repeatedly calling the complainant to the CBI office to harass him and compel him to pay a bribe of Rs 5 crore for getting a clean chit in the case.
The complaint had also said a part of the bribe was paid by Sana.
( With inputs from PTI )