Code of Criminal Procedure contains lot of provisions that give powers to Police/investigating agencies to take an accused person into their custody (police custody in the lockup cell of a Police station, where lockup deaths happen). At the same time, time limits were placed on such custody for inquiry/investigation so as to protect the fundamental rights of accused. When such time limits expire, Courts are empowered (actually duty-bound) to order for release of such accused at the expiration of such statutory time-limits.
Here are the provisions.
As per subsection (2) of section 167 CrPC, the following situation allows for default bail for an accused.
(2) XXXXX:
Provided that—
(a) XXXXX, but no Magistrate shall authorise the detention of the accused person in custody under this paragraph for a total period exceeding—
(i) ninety days, where the investigation relates to an offence punishable with death, imprisonment for life or imprisonment for a term of not less than ten years;
(ii) sixty days, where the investigation relates to any other offence, and,
on the expiry of the said period of ninety days, or sixty days, as the case may be, the accused person shall be released on bail if he is prepared to and does furnish bail, and every person released on bail under this sub-section shall be deemed to be so released under the provisions of Chapter XXXIII for the purposes of that Chapter;
Also, obviously
Explanation I.—For the avoidance of doubts, it is hereby declared that, notwithstanding the expiry of the period specified in paragraph (a), the accused shall be detained in custody so long as he does not furnish bail.
As per subsection (2A) of section 167 CrPC, the following situation allows for default or statutory bail for an accused.
(2A) Notwithstanding anything contained in sub-section (1) or sub-section (2), the officer in charge of the police station or the police officer making the investigation, if he is not below the rank of a sub-inspector, may, where a Judicial Magistrate is not available, transmit to the nearest Executive Magistrate, on whom the powers of a Judicial Magistrate or Metropolitan Magistrate have been conferred, a copy of the entry in the diary hereinafter prescribed relating to the case, and shall, at the same time, forward the accused to such Executive Magistrate, and
thereupon such Executive Magistrate, may, for reasons to be recorded in writing, authorise the detention of the accused person in such custody as he may think fit for a term not exceeding seven days in the aggregate; and, on the expiry of the period of detention so authorised, the accused person shall be released on bail except where an order for further detention of the accused person has been made by a Magistrate competent to make such order; and, where no order for such further detention is made, the period during which the accused person was detained in custody under the orders made by an Executive Magistrate under this sub-section, shall be taken into account in computing the period specified in paragraph (a) of the proviso to sub-section (2):
Some helpful cases laws are here.
Index of all Bail matters is here.