In addition to those juveniles specified in Section 850, the probation officer may receive and detain in the county juvenile hall any juvenile committed thereto by process or order issued under the authority of the United States until such juvenile is discharged according to law as if he had been committed under process issued under the authority of this state, provided, that, in the absence of a valid detention order issued by a federal court, such detention shall not exceed three judicial days. Juveniles detained pursuant to this section shall have all the rights, powers, privileges, and duties, and shall receive the same treatment, afforded juveniles detained pursuant to the laws of this state. The board of supervisors of a county may contract with the United States for reimbursement of the county’s cost incurred in the support of such juvenile.