WeWork announced on Wednesday it accepted a rescue package from SoftBank Group Corp., its largest investor, that will give the Japanese conglomerate an 80 percent stake in the company.

The deal marks the end of an era for the troubled co-working giant, which raised money at a $47 billion valuation in January, pulled out of a botched initial public offering attempt last month and is now valued at less than $8 billion in the bailout.

WeWork founder Adam Neumann will leave the company's board as part of the package, to be replaced by SoftBank executive and newly appointed Executive Chairman Marcelo Claure. Neumann is set to walk away from the deal with as much as $1.2 billion in WeWork stock, a $500 million credit line from SoftBank and a roughly $185 million consulting fee, people familiar with the matter have said. Neumann will remain connected to the company as a board observer.