Japanese telecommunications giant SoftBank is taking control of WeWork, and it’s giving WeWork founder Adam Neumann the equivalent of nearly $1.7 billion to sever most of his ties with the shared office space startup, according to The Wall Street Journal and the Financial Times. SoftBank will also spend up to $3 billion buying out shares owned by employees and early investors in the company, and it’s lining up some $5 billion in debt financing to help the startup move forward. This is all on top of the more than $10 billion SoftBank has already committed to WeWork as its largest investor.

Neumann will reportedly sell $1 billion worth of his WeWork stock to SoftBank as part of the takeover bid. SoftBank will also pay him a $185 million “consulting fee” and will extend him a $500 million line of credit, the Journal reports. The board of directors of the We Company — WeWork’s parent company — reportedly chose SoftBank’s deal over a competing bid from JPMorgan Chase & Co.

Including a $185 million “consulting fee”

The deal, which is expected to be formally announced as early as Tuesday, could help wrap up a wild season of the soap opera that is WeWork. WeWork’s business model — lease and refurbish office space and then rent out smaller spaces like desks and individual offices — had always been scrutinized. But public perception of WeWork really started to turn in January of this year when the startup changed its name to The We Company to accommodate for new businesses like a residential play called WeLive and a school called WeGrow.

Things really went off the rails after WeWork submitted paperwork to the government to become a publicly traded company. When that document became public in August, it raised a serious amount of red flags, from the severe amount of control Neumann and his wife exercised over the company to moves that bordered on self-dealing (like licensing the “We” trademark to his own company), all on top of massive losses. The backlash was swift; in less than two months, Neumann stepped down as CEO, and WeWork pulled its IPO. The startup began spinning off some of the businesses it acquired and shuttering others, like WeGrow.

The startup has also been reportedly on the brink of laying off as many as a few thousand employees, but it is allegedly so low on cash at the moment that it would not be able to cover the severance payments required to pull that off, making the closure of the new deal with SoftBank even more imperative.

Representatives for WeWork did not respond to a request for comment.