A federal prison is operated under the jurisdiction of a federal government as opposed to a state or provincial body. Federal prisons are used for convicts who violated federal law (U.S., Mexico), inmates considered dangerous (Brazil), or those sentenced to longer terms of imprisonment (Canada). Not all federated countries have a legal concept of "federal prison".
There are no federal prisons in Australia. The Directors of Public Prosecutions are responsible for all criminal offenders, whether the charges are state or federal. However, federal prosecution takes place in the territory of the crime committed as the federal courts have no jurisdiction. The offender, if convicted, will be sentenced to the correctional facility closest to their territory. 
The Brazil federal prison system (Sistema Penitenciário Federal) was implemented in 2006 based on the provisions of the 1984 law "Lei de Execução Penal". It receives the most dangerous criminals who would be disruptive in state prisons.
In Canada, the Correctional Service of Canada operates federal penitentiaries, which house inmates with sentences of two years or more; provincial prisons are responsible for those with shorter terms.
The prisons in Germany are run solely by the federal states, although governed by a federal law.
The Federal Bureau of Prisons (BOP), established with the passing of the Three Prisons Act of 1891, is responsible for the administration of federal prison facilities in the United States, as well as the custody and welfare of federal inmates. The BOP also provides researchers with background information and statistics regarding the Federal Prison System.