A prison, also known as a jail, gaol, penitentiary, detention center, correction center, correctional facility, or remand center, is a facility where people are imprisoned under the authority of the state, usually as punishment for various crimes. They may also be used to house those awaiting trial (pre-trial detention). Prisons serve two primary functions within the criminal-justice system: holding people charged with crimes while they await trial, and confining those who have pleaded guilty or been convicted to serve out their sentences.