California's governor has signed into law a statewide ban on private prisons and federal immigration detentions centres.

The law, which will go into effect on 1 January, bars the California Department of Corrections and Rehabilitation from entering into or renewing a contract with a private company to run a state prison, unless needed to meet court-ordered inmate housing limits.

The law will also ban the incarceration of anyone in a privately run facility at all by the year 2028.

In a statement to Reuters, governor Gavin Newsom said the law was a fulfilment of his promise to abolish private prisons upon taking office in January 2019, "because they contribute to over-incarceration, including those that incarcerate California inmates and those that detain immigrants and asylum seekers."

"These for-profit prisons do not reflect our values," the statement said.

Death row in California's San Quentin prison Show all 8 1 /8 Death row in California's San Quentin prison Death row in California's San Quentin prison A condemned inmate exercises in a cage out in the yard of San Quentin prison Getty Death row in California's San Quentin prison San Quentin State Prison opened in 1852 and is California's oldest penitentiary. The facility houses the state's only death row for men that currently has 700 condemned inmates Getty Death row in California's San Quentin prison The lethal injection facility at San Quentin prison AP Death row in California's San Quentin prison A condemned inmate stands in a cell out in the yard of San Quentin prison Getty Death row in California's San Quentin prison An armrest in the interior of the lethal injection facility at San Quentin prison AP Death row in California's San Quentin prison A cell on death row in San Quentin Getty Death row in California's San Quentin prison A cage on death row in San Quentin Getty Death row in California's San Quentin prison A cell on death row in San Quentin Getty

In California, the law will affect seven low-security facilities collectively housing over more than 5,000 people. They are all operated either by GEO Group, based in Florida, or CoreCivic, based in Tennessee.

The last three remaining privately run prisons in California's corrections system will close within the next four years under the law. These house 1,400 people collectively.

Additionally, Immigration and Customs Enforcement, or ICE, will lose four privately run detention centres holding approximately 4,000 people throughout the state.

The law will not apply to privately owned prisons operated and staffed by the state corrections agency.

The existence of private, for-profit prisons is being challenged throughout the country by activists who argue that they face little oversight, and contribute to nation’s high rate of incarceration by making it less expensive to lock up people indefinitely than attempt to rehabilitate inmates.