Whenever there is an unfit or insecure jail in any county, the judicial officers of such county may commit any persons brought before them, whether in a criminal or civil proceeding, to the jail of any adjoining county, for the same causes and under the like regulations that they might have ordered commitments to the usual jail; and the sheriffs and other officers of such county in which there is an unfit or insecure jail, and the sheriffs or keepers of the jails of the adjoining counties, shall obey any order of commitment so made. (1835, c. 2, s. 2; R.C., c. 87, s. 3; Code, s. 3458; Rev., s. 1350; C.S., s. 1354; 1973, c. 57, s. 2; c. 822, s. 3; 1983, c. 670, s. 17.)