California Gov. Gavin Newsom signed a bill on Friday that would eliminate private, for-profit prisons, including those used for immigration detention, by 2028.

Starting on Jan. 2020, the state's Department of Corrections and Rehabilitation won't be able to enter into or renew a contract with a private, for-profit prison to incarcerate people.

Operating a private immigration detention facility and incarcerating people in for-profit prisons will be prohibited after Jan. 2028, according to the newly signed law.

"During my inaugural address, I vowed to end private prisons, because they contribute to over-incarceration, including those that incarcerate California inmates and those that detain immigrants and asylum seekers," Newsom said in a statement. "These for-profit prisons do not reflect our values."

The Adelanto Detention Facility, which is one of the nation's biggest privately-run immigration detention centers, will be phased out under the new law.

This past summer, the Department of Homeland Security's Office of Inspector General released a report that found "egregious violations of detention standards" at the Adelanto Detention Facility, including "nooses in detainee cells, improper and overly restrictive segregation, and inadequate detainee medical care."

Mario, a 31-year-old Mexican immigrant who wished to only be identified by his first name to avoid government attention, was happy about the news. He was detained for six months at Adelanto, which he described as "a form of psychological torture and even abuse," adding that the "conditions there were horrible."

"The key word here is 'for-profit,'" he told NBC News. "That means they will make sure they maximize profits and they are willing to cut back on things like medical services and even food."

GEO Group, a for-profit prison company with dozens of facilities in California including the Adelanto Facility, previously has stated that the bill "works against the state’s Proposition 57 anti-recidivism goals approved by the voters," referring to a ballot proposition passed in 2016 to reduce the number of people who were re-incarcerated in the state.

The company reported revenues of $2.33 billion in 2018, up from $2.26 billion in 2017. The facilities have been criticized for employing immigrants for as little as $1 a day.

California Assemblymember Rob Bonta, who authored the bill, describe Newsom's action as a "truly historic moment for California."

"By ending the use of for profit, private prisons and detention facilities, we are sending a powerful message that we vehemently oppose the practice of profiteering off the backs of Californians in custody, that we will stand up for the health, safety and welfare of our people, and that we are committed to humane treatment for all," said Bonta in a statement.

Asked about the impact of the bill on ICE operations, spokesperson Paige D. Hughes said, "The idea that a state law can bind the hands of a federal law enforcement agency managing a national network of detention facilities is wrong. In this situation, ICE will likely have to transfer individuals a greater distance from their arrest location to where they’d be detained."

But for Lizbeth Abeln of the Inland Coalition for Immigrant Justice, who helped push forward the legislation, the bill's signing was a step forward, as she said during a press conference Friday afternoon.

"People were tired of this ridiculous notion that somehow the city was prosperous because of these private prisons when in fact private prisons prey on vulnerable cities like Adelanto," she said. "We are joining a national effort, and California is leading this, in which we are going to divest from these abusive systems."

Follow NBC Latino on Facebook, Twitter and Instagram.