When America's largest private prison company opened a 2,000-bed facility in a barren stretch of the Mojave Desert in southeastern California in 1997, there was no guarantee that any inmates would ever reside there.

California's exceptionally powerful prison guard union was waging a fierce campaign against private prison companies, telling voters that the facilities were poorly run and that the industry would take away union jobs. "Public safety should not be for profit," Don Novey, president of the prison guard union, told the San Francisco Chronicle at the time.

Still, David Myers, the president of Corrections Corporation of America, a Nashville-based giant of the for-profit prison industry, believed his company's decision to build a prison in that remote corner of the state would eventually pay off.

Sixteen years later, as California struggles to relieve overcrowding in one of the nation's largest prison systems, the inmates are coming by the thousands.

Last week, Gov. Jerry Brown (D) signed a three-year deal to lease the CCA prison at $28.5 million per year. The prison is currently occupied by federal inmates and operates at well under full capacity, according to recent reports.

Along with two other private-prison deals inked by Brown in September with a different company, the GEO Group, the move punctuates a period of extraordinary growth for the private prison industry in California. Between 2008 and 2012, CCA's revenues in the state more than doubled, even as the company's growth began to slow in other states throughout the country, according to a HuffPost analysis of the company's annual financial documents.

Advocates for prisoners' rights and their allies in the state legislature say that Brown's investments in the private prison system could hamper efforts to change California's tough sentencing laws so that fewer people go to prison in the first place.

"We keep sending more people to prison than the prisons can handle," said Donald Specter, who heads the Prison Law Office, a Berkeley-based public interest firm.

Inmates at the Mule Creek State Prison in a gymnasium that was modified to house prisoners. This photo was taken at the height of the prison overcrowding crisis in 2007. Since then, the state has reduced its prison population by thousands, but the prisons are still too crowded, according to a federal panel of judges.

CCA alone holds more than 8,000 California inmates at facilities in Arizona, Mississippi and Oklahoma. The company's new deal with California expands the state's prison capacity by an additional 2,300 prisoners, and California's contracts with the GEO Group add another 1,400. Along with an existing private prison contract in the state, the new contracts bring California's total number of private-prison inmates to about 12,300.

California is now CCA's second-biggest customer, providing $214 million to the company last year, according to HuffPost's analysis of the company's finances. The state is surpassed only by the federal government, which paid CCA $752 million last year, a figure that accounts for contracts with three agencies -- the U.S. Marshals Service, the Federal Bureau of Prisons, and Immigration and Customs Enforcement. The state of Georgia, the company's third-largest client, paid $99 million last year.

As CCA's presence in California has grown, the company has significantly boosted its spending on political campaigns and lobbying in the state, a HuffPost analysis of campaign finance data found. It spent nearly $290,000 on California campaigns during the 2011-12 election cycle, up more than eightfold from the 2005-06 cycle.

Since running for governor in 2010, Brown has taken in $15,000 from CCA, which also spent $50,000 in support of his initiative to raise taxes. And he received $25,900 from the GEO Group. (Hedging its bets, the GEO Group also contributed $25,900 to his 2010 Republican opponent, Meg Whitman.)

Evan Westrup, a spokesman for Brown's administration, said that the contributions played no role in Brown's decision to sign the new contracts. Steve Owen, a CCA spokesman, said that lobbying allows the company to "educate" government about "the types of solutions we provide and to stay current on issues that affect our ability to best serve our partners."

"Under longstanding policy, CCA does not take a position on or in any way promote policies that determine the basis or duration of an individual's incarceration," he added.

Overall, California houses about 119,000 prisoners within its borders and thousands more in CCA prisons in other states, and it has one of the most crowded prison systems in the country. In 2009, a panel of federal judges concluded that the in-state prisons were so densely packed that prisoners were dying as a result. The judges ordered the state to reduce overcrowding.

In 2011, the U.S. Supreme Court upheld the ruling, with Justice Anthony Kennedy declaring in the majority opinion that the lack of adequate space in California's prisons was causing at least one inmate to "needlessly die" every six or seven days.

The California City Correctional Center is seen under construction, in the Southern California Mojave Desert town of California City, on May 3, 1999.

Brown responded by shifting responsibility for certain nonviolent offenders from the state to county governments. Within two years, the state prison population declined by about 25,000.

But that didn't satisfy the federal judges, who have given the state until the end of February to come up with a plan to further decrease the system's population by about 10,000 inmates. Brown's recent deals with CCA and the GEO Group represent attempts to meet that quota. He's also negotiating with top Democratic lawmakers who hope to scale back the prison population over the next two years by bolstering funding for substance-abuse treatment programs, which are aimed at keeping more non-violent offenders out of prison.

Specter, the Prison Law Office director, argues that private prison deals exacerbate the problem. "Instead of facing the sort of politically tougher questions of how to revise the sentencing structure, the state uses the private prisons as the release valve," he said.

In recent years, states around the country have dramatically lowered the size of their prison populations, in part by reforming their sentencing laws. In Texas and other states, entire prisons have closed in the wake of these changes.

California has adopted some sentencing reforms, such as a 2012 ballot measure that narrowed the scope of the state's Three Strikes Law. The law used to require the state to impose life sentences on anyone convicted of a third felony, no matter how minor. Under the revised law, the crime must be a violent one, like murder, or a "serious" one, like assault with intent to commit robbery.

But advocates for criminal justice reform say the state hasn't gone nearly far enough to ensure that prisons are reserved for people who threaten public safety. They argue that California is struggling with overcrowding not because it lacks enough space for all of its prisoners, but because it continues to lock up too many people for too much time.

These critics want the state to meet the federal judges' demands by softening more of its sentencing laws. Under one such law, people caught with a small amount of heroin or cocaine for their own use can end up serving a mandatory sentence of up to three years in a state prison.

"It's outrageous in the 21st century that we still incarcerate people for having a small amount of drugs," said Susan Burton, director of A New Way Of Life, a Los Angeles organization that helps women who have been released from prison. "We know that drug addiction is a medical issue, and still we punish people for having drugs in their possession."

Not so long ago, Brown himself was an outspoken champion of sentencing reform. As mayor of Oakland in 2003, he called the state's sentencing system an "abysmal failure" and said he regretted his role in establishing it during his first stint as governor in the late 1970s. By locking people up for fixed terms, he said in 2003, the state was denying prisoners any real incentive to acquire the life skills needed outside of the prison system, creating what he referred to as "postgraduate schools of crime."

Inmate Leon Browne, 21, of Los Angeles, right, sat on his bunk in a prison gymnasium in 2007. At the height of the prison overcrowding crisis several years ago, the gym served as a temporary "emergency" sleeping area at California State Prison-Los Angeles County in Lancaster, Calif. The state has lowered the prison population since then, but has yet to satisfy a federal court's requirements for relieving overcrowding.

In his current term as governor, however, Brown has repeatedly pushed back against proposals to change the state's sentencing guidelines. Earlier this month, he vetoed a bill that would have reduced sentences for defendants caught with cocaine, heroin and various other illegal drugs. (He said he'd consider including the proposal in a larger package of measures aimed at satisfying the federal court's overcrowding requirement.)

At a press conference in August, Brown said that the state could not further scale back its prison population without releasing dangerous felons. "Public safety is the priority," he said.

But critics say the state incarcerates many prisoners who pose no real danger to the public, including elderly inmates and the terminally ill. And they argue that the governor could safely decrease the prison population by allowing more inmates to earn reduced sentences for good behavior.

James Austin, president of the the JFA Institute, a national criminal justice research group, testified in the state's overcrowding case that California could safely release 22,758 prisoners. Using a computer program developed by the state, he determined that 40 percent of all California prisoners were unlikely to return to prison within three years of their release. Letting them out early would constitute a "safe and effective" way to meet the population target, he remarked in his testimony.

Although Brown's new contracts with CCA and the GEO Group are set to expire after three years and five years, respectively, critics worry that the state may extend the deals. Since California first started sending inmates to private prisons out of state in 2006, officials have renewed, and in some cases expanded, several contracts. "I just don't see these contracts going away," said Glenn Backes, a lobbyist for the Drug Policy Alliance, a national group that advocates for prison reform.

Such concerns stem in part from the fact that the arrangements could deprive prison reformers of an unlikely but potent ally: the prison guard union.

For years, California's prison guard union, the California Correctional Peace Officers Association, served as a powerful check on the growth of the private prison industry. The union spent millions to support the campaigns of political allies, and launched media attacks that were widely seen as lethal to the political aspirations of opponents.

Now the union and the private companies are partners. Brown's deal with CCA stipulates that the state will staff the private facility with union guards, effectively creating a detente between the former foes. When Brown first announced the deal in August, the union's leader, Mike Jimenez, joined him on stage in a show of solidarity.

Advocates for prisoners' rights and criminal justice reform worry that this alliance could prove particularly damaging to sentencing reform efforts, expanding the prison system for years to come.

"This is a politically powerful model," Backes said. "There will be nothing temporary about this growth."

Only 7 percent of Americans think the United States is <a href="http://www.rasmussenreports.com/public_content/lifestyle/general_lifestyle/november_2012/7_think_u_s_is_winning_war_on_drugs">winning the war on drugs</a>, and few Americans are interested in throwing down more money to try to win, according to a Rasmussen Reports poll released in 2012.