When there is no sufficient prison in any county, every judicial or executive officer of such county who has power to order or sentence any person to the county jail, may, upon application of the sheriff, order any person charged with a criminal offense whereof such officer has jurisdiction, and ordered to be committed to prison, to be sent to the jail of the county nearest having a sufficient jail, and the sheriff of such nearest county shall, on exhibit of such order, receive and keep in custody, in the jail of his county, the prisoner ordered to be committed as aforesaid, at the expense of the county from which said prisoner was sent, and the said sheriff shall, upon the order of the officer committing such prisoner, redeliver such prisoner when demanded.
Okla. Stat. tit. 57, § 64