The jail of any county may be used for the confinement of persons committed thereto under the laws of the United States. The jailer thereof shall receive, keep and discharge such persons pursuant to the commitment, as provided in the laws of the United States. For a failure of duty as to any such prisoner, the jailer shall be liable to the United States, or to the creditor at whose suit the prisoner is in custody, in like manner as in case of a prisoner committed under the authority of the state. No person arrested on civil process shall, under this section, be committed to any other jail than that of the county within which such person may reside or be found.
The United States or the creditor, as the case may be, shall be responsible to the county court for payment of the costs for the maintenance of any person confined in a county jail as provided in this section.