All sheriffs, jailers, prison keepers, and their deputies, within this state, to whom any persons shall be sent or committed, by virtue of legal process, issued by or under the authority of the United States, shall receive such persons into custody, and keep them safely until discharged by due course of the laws of the United States; and all such sheriffs, jailers, prison keepers and their deputies, offending in the premises, shall be liable to the same pains and penalties, and the parties aggrieved shall be entitled to the same remedies against them, or any of them, as if such prisoners had been committed to their custody by virtue of legal process issued under the authority of this state.
R.L. 1910, § 4619.