NEW YORK (Reuters) - Just a few months ago, WeWork’s co-founder Adam Neumann was being courted by Wall Street’s top investment bankers in anticipation of one of this year’s most high-profile initial public offerings.

FILE PHOTO: Adam Neumann, CEO of WeWork, speaks to guests during the TechCrunch Disrupt event in Manhattan, in New York City, NY, U.S. May 15, 2017. REUTERS/Eduardo Munoz

By October, with the IPO abandoned and his office-space sharing company bleeding cash, Neumann found himself late on a Sunday evening pleading with WeWork’s largest lender for a $5 billion lifeline, people familiar with the matter said. The message was clear - without new financing WeWork would run out of money within weeks.

"Do you still believe in the company?" Neumann, who had stepped down as CEO but was still WeWork's chairman, asked a room of JPMorgan Chase & Co JPN.N bankers on the 42nd floor of their midtown Manhattan headquarters on Oct. 6, the sources said.

The JPMorgan bankers, led by asset and wealth management CEO Mary Erdoes and debt capital markets head Jim Casey, told Neumann and other WeWork directors they would back the company, and were confident they could raise the money. But they would not underwrite the deal on the spot, as one board member requested.

With questions swirling around WeWork’s chances of survival in the wake of its failed IPO, the bankers told Neumann they needed some time to sound out investors first, according to the sources.

A few days later, an alternative rescue plan began to emerge from WeWork's largest shareholder, Japan's SoftBank Group Corp 9984.T.

Both were far from perfect. But given its dire straits, WeWork was fortunate to have a choice.

This account of how WeWork’s financial rescue came together over the past three weeks is based on interviews with eight people with knowledge of the negotiations. They requested anonymity to discuss the confidential deliberations.

WeWork, SoftBank and JPMorgan declined to comment for this story.

Requests for an interview with Neumann were also declined.

CORPORATE GOVERNANCE PROBLEM

SoftBank offered $9.5 billion to WeWork, including new debt and recommitted equity, as well as a tender offer to partly cash out Neumann and other shareholders.

In addition to providing more funds than JPMorgan, the SoftBank deal resolved what some WeWork directors privately referred to as the company’s “corporate governance problem” - Neumann’s controlling grip.

SoftBank’s deal would strip Neumann’s voting power and remove him from the board. Neumann was blamed by other WeWork investors such as Benchmark Capital and China’s Hony Capital, for the company’s precipitous decline, some of the people said.

His erratic management style, combined with WeWork’s lack of a clear path to profitability, alienated potential IPO investors.

Slideshow ( 2 images )

The problem was that Neumann could still wield power over the company even after he quit as CEO on Sept. 24 because, as WeWork’s founder, each of his shares had 10 voting rights. Others had only one vote for every share.

It was clear to SoftBank, as well as to a special board committee formed to consider the financing plans, that Neumann relinquishing control would come with a price tag, three of the people said.

CLAURE AND NEUMANN NEGOTIATE

In meetings in New York between Neumann and SoftBank Chief Operating Officer Marcelo Claure, the contours of a side deal came together. SoftBank would provide a $500 million credit line to refinance Neumann’s personal borrowings made against WeWork’s stock, as long as he used proceeds from cashing out up to $970 million of his shares to repay SoftBank for that loan first.

SoftBank’s latest offer valued the company at as little as $5.9 billion based on the repricing of warrants it was already committed to exercise, according to Bernstein research, a far cry from the $47 billion it had assigned to WeWork in January.

Neumann’s special pay-off did not stop there. He negotiated with SoftBank a four-year non-compete agreement with a $185 million “consulting fee” in return for stepping down from WeWork’s board. He would now only get to observe board proceedings instead of participating.

WeWork’s special board committee members expressed concern that Neumann’s bailout would cause outrage among many WeWork employees whose stock options had a much higher strike price than the valuation in SoftBank’s tender offer, some of the people said.

The committee declined to comment for this article.

SoftBank’s offer to buy up to $3 billion of WeWork stock from employees and existing shareholders would value the company at about $8 billion, higher than the new valuation based on the warrants.

Neumann attempted to push up the valuation of the tender offer in his negotiations with SoftBank, one of the people said.

SoftBank stood firm. Anticipating criticism from its own shareholders for possibly throwing good money after bad, it wasn’t prepared to pay more.

Most WeWork directors wanted Neumann off the board, and many minority shareholders, which the special committee was formed to represent, wanted to cash out, the people said.

JPMorgan had not pursued raising additional money for shareholders, in part because WeWork only tasked the bank with delivering $5 billion of debt financing.

JPMORGAN’S COVENANT

When the bank submitted the debt package on Monday, only private equity firm Starwood Capital Group, run by real estate mogul Barry Sternlicht, had committed to join JPMorgan in sharing the financing burden.

JPMorgan agreed to provide the rest and transfer the money by Thursday. But the deal also included a condition, known as a covenant, that would trigger a debt default if SoftBank did not make good on $1.5 billion that it had already committed to provide when warrants came due next April, the people said.

JPMorgan wanted to ensure SoftBank would honor its financial commitment, which would lessen the risk for investors holding debt that would one day need to be repaid.

But SoftBank told WeWork’s board that it would not pay the $1.5 billion if its financing offer was rejected, two of the people added.

The problem from SoftBank’s perspective was that those warrants were based on January’s $47 billion valuation of WeWork. It wanted to change the pricing radically to reflect WeWork’s dramatic fall in value.

JPMorgan dealmakers, on the other hand, believed WeWork’s contract with SoftBank prevented the telecommunications and technology giant from reneging on that earlier commitment, other people familiar with the matter said.

In the end, the risk that SoftBank wouldn’t fulfill its commitment if the JPMorgan financing package was chosen helped swing the special committee’s deliberations in favor of SoftBank’s offer, they added.

SoftBank had made WeWork an offer it had to accept.

On Tuesday, SoftBank unveiled a deal that increased its ownership of WeWork to 80% from 30%, but sought to avoid having to consolidate WeWork’s liabilities on its balance sheet by not taking full control of the expanded board. SoftBank will only have 5 of the 10 seats.

But unless SoftBank can turn WeWork around quickly, it could be a pyrrhic victory.

WeWork has burned through almost $2.5 billion of cash since the end of June, and Claure will have to cut costs quickly, including slashing thousands of jobs and helping the company to find a way to get out of expensive leases. Otherwise, the new cash injection may not last long enough to stabilize the business.

As predicted, Claure is also facing some staff anger over the size of Neumann’s payout. He told employees on Wednesday that it was the “price” that had to be paid to get rid of Neumann’s voting rights. Otherwise, he said, “Adam could do whatever he wanted.”

(The story corrects Erdoes’ job description in paragraph 4.)