Tesla Motors CEO Elon Musk, left, and Nevada Gov. Brian Sandoval shake hands following a press conference where Nevada was announced as the new site for a $5 billion car battery gigafactory, at the Capitol in Carson City, Nev., on Thursday, Sept. 4, 2014. (AP Photo/Cathleen Allison)

Correction: A quote attributed to Tesla executive Diarmuid O’Connell contained an incorrect word. O’Connell said the company had “no starting ask,” not “no starting end.”

Last October, representatives from Tesla reached out to economic development officials in a handful of Western states with an enticing offer: The company, which manufactures luxury electric vehicles, needed a new site on which to build a massive factory to produce lithium ion batteries. The facility would cost about $5 billion to construct, and it would employ about 6,500 high-tech manufacturing employees.

Eleven months later, Tesla CEO Elon Musk stood next to Nevada Gov. Brian Sandoval (R) to announce that the project, dubbed the “Gigafactory,” would break ground at an industrial park near Reno. Scoring the project was a major coup for Sandoval, who was already likely to easily win re-election this year, and for Senate Majority Leader Harry Reid, who helped pressure the company to choose his home state.

But landing the Gigafactory did not come cheap. Interviews with officials in several of the states involved in winning the project show Tesla knew it was playing in a buyer’s market, and it used the promise of billions in investment and thousands of high-paying jobs to win concessions, even in states that will not ultimately host the project.

Tesla is hardly the only company that uses the promise of massive economic activity to win special tax breaks. The company’s ability to pit states against one another mirrors strategies used by other corporations like Boeing, Nike, Royal Dutch Shell to boost their negotiating power. In the last three decades or so, states have awarded corporations more than $64 billion in subsidy packages aimed at luring those companies and the jobs they bring, according to a report from Good Jobs First, a group that monitors corporate mega-deals.

In a tenuous recovery from a devastating recession, corporations find themselves in increasingly strong negotiating positions. The story of one company’s efforts to play states off each other illustrates just how far those states will go to land high-paying manufacturing jobs.

On paper, the states competing for Tesla’s business had good reason to put together an attractive package: Some academics estimated the Gigafactory would bring up to $100 billion in economic activity to whichever state won the project. Such a massive building project with so much economic potential comes around perhaps once a decade, especially for rural Western areas hit hard by the recession.

So when the company approached potential hosts, teams of economic development officials from several Western states started putting together detailed plans of incentives and credits aimed at luring the company’s business. The five major players — Nevada, California, Arizona, New Mexico and Texas — kept the details of those plans secret, as did Tesla.

“We didn’t know, and still don’t know, what the other states were offering,” Sandoval said in an interview.

In the initial stages of its latest project, Tesla did not make an explicit request for specific incentives, leaving it up to the states to be creative.

“There was no starting ask. There was a presentation of the opportunity, of the plan, what we were going to do, and an invitation to participate in a dialogue of what economic development programs in the state were available,” Diarmuid O’Connell, Tesla’s vice president of business development, said in an interview.

As negotiations evolved, it became clear Tesla was asking for a lot. The company wanted a package worth at least $1 billion, including tax breaks and incentives, reimbursement of expenses, and even cash up front, according to two sources involved in the negotiations. It needed easy access to railroads and other transportation options to ship the lithium batteries to the assembly plant in California, along with access to renewable energy sources.

In a February blog post, Tesla announced it would focus on four states, leaving California out of the mix. Officials there were taken aback: After all, their state law allowed Tesla to sell directly to consumers, without going through a dealer.

Gov. Jerry Brown’s (D) economic development office, GoBIZ, let Tesla know it wasn’t going down without a fight. They enlisted the help of Sen. Dianne Feinstein (D), who called Tesla founder Elon Musk on March 4 and urged him to reconsider. Throughout the spring, state Sen. Ted Gaines (R) worked with state Senate President Darrel Steinberg (D) to put together an incentive package that would convince the company they would do well to stay in-state; Tesla already employs more than 6,000 people in California, where it is headquartered.

“We presented it in such a way that everything was on the table,” Gaines said in an interview. That included investment tax credits, removing regulatory hurdles and even rethinking the state’s environmental rules and regulations. In an interview in early June, Tesla’s top communications official said the state was back in the game.

In recent years, other states have made similar sacrifices to keep or attract big companies. Last year, Washington State legislators passed an $8.7 billion package of incentives and tax breaks, spread out over the next 27 years, to secure a Boeing production facility. In 2012, Oregon legislators passed a package of tax breaks worth $2 billion to keep a Nike facility in the Portland area.

Tesla inspected almost 100 different sites in Western states, O’Connell said. That included 31 in California alone; local utilities in Sacramento held discussions with Tesla officials over whether they could provide enough power to operate the huge facility. In Nevada, company officials considered sites in both the Reno and Las Vegas areas. San Antonio, Texas, made a large and loud public push to win the Gigafactory.

With secrecy at a premium, rumors flew: Economic development officials in every competitive state scoured press reports for any hint of what other states were offering. Some states were said to be offering cash up front to help the company build. All five states would have to allow Tesla to sell their vehicles directly to consumers, breaking the normal model of car sales whereby auto dealers act as middle men between manufacturers and customers. In Nevada, company officials made clear the state would need to create a tax abatement for manufacturing equipment, which most other states already allow.

As California got back in the game and Nevada put together its case, Texas’s hopes were slipping. Gov. Rick Perry (R), who visited Tesla headquarters in June while on a political fundraising trip, made clear that Texas would not allow the company to circumvent auto dealers by selling its vehicles directly to consumers.

Nevada, meanwhile, sent early signals that it would do just that. The current law was ambiguous: The state’s Department of Motor Vehicles had created an administrative rule that appeared to ban direct sales, but Sandoval and legislators made clear they would change that.

Back in Washington, federal officials got involved. Reid, the Senate Majority Leader, had hosted Tesla founder Elon Musk at a 2012 energy summit. Throughout the year, Reid and Musk spoke several times by phone. Feinstein was also weighing in for her state. In May, Sen. John McCain (R-Ariz.) brought Michael Crow, president of Arizona State University, to Tesla’s headquarters in Palo Alto to meet Musk.

But throughout the spring and summer, among competitors around the West, optimism turned to pessimism. In California, Brown’s final offer to Tesla topped out around $500 million, less than half the total offer made by Sandoval’s office.

Nevada’s bargaining position strengthened in July, when Tesla told investors it had broken ground at the Tahoe-Reno Industrial Center. The facility, in rural Storey County, is already home to WalMart’s western distribution center and to corporations like Zulily, an internet clothing company, and PetSmart.

The deal still wasn’t done, however. Tesla returned to the bargaining table to demand up-front assistance, which would have totaled up to $500 million, according to the Nevada journalist Jon Ralston. Sandoval, in an interview, said he was unwilling to fork over money out of pocket. “I wasn’t in a position to do that, nor did I want to do that,” he said.

O’Connell denied that his company asked for cash from the states involved in negotiations. But, he said, tax abatements and incentives typically aid a company toward the end of their ten- or twenty-year agreement with states, and Tesla wanted Nevada to offer what he called “up-front assistance.”

Reid himself jeopardized negotiations at one point in August by questioning whether Tesla was serious about making Reno its home. “I would not start counting jobs on Tesla now,” Reid said at a Reno news conference. “I will say, I’m not sure they aren’t playing us.” Company officials were miffed at what they perceived as an insult.

But by Tuesday, Sept. 2, Musk called Sandoval to inform the governor his state was about to receive the $5 billion Gigafactory. Sandoval began briefing legislative leaders on his plan, a package of tax abatements and incentives, funded in part by ending a film tax credit he had signed into law just a few months before.

At a press conference Thursday morning, Sandoval said he would call the legislature back into session to vote on the plan. In politics, success has a thousand fathers, but Sandoval and Reid — occasional rivals for political supremacy who may run against each other in 2016 — bent over backwards to share credit.

“[H]e has been there every step of the way,” Sandoval said of Reid at the press conference. On the Senate floor, Reid said Sandoval’s “patience and diligence made this possible.”

Some wonder whether the big tax breaks it took to land the deal are worth the larger costs to the state. Among the estimated 240 tax subsidies worth more than $75 million passed by state legislatures since 1976, the average has cost a state $456,000 per job, according to the Good Jobs First report.

“This looks like a tragic example of a state over-paying for a trophy deal,” said Greg LeRoy, the group’s executive director. “This is a tax credit grab, with a capital H hubris.”

Nine days after Musk called Sandoval, the legislature took up the tax and incentives package. All 63 members of the Senate and the Assembly voted to give Tesla what it wanted.