Four years ago, many believed Navistar was headed towards an almost certain bankruptcy.

The truck maker had squandered billions on a diesel engine that didn’t win the approval of the Environmental Protection Agency, in a move insiderslikened to “betting on the diesel version of Betamax when the rest of the world is going to VHS.” One of Navistar’s top shareholders, Carl Icahn, would often refer to then-CEO Daniel Ustian as a “crazy uncle” working on a failed multi-billion dollar pet project in his garage.

But Navistar didn’t fold and now there are concrete signs that the Lisle, Illinois-based company is going from the brink of bankruptcy to more stable footing.

A Navistar International Corp. International HX Series truck sits at the company’s headquarters in Lisle, Illinois, U.S., on Tuesday, Jan. 19, 2016.  Photographer: Chris Dilts/Bloomberg

On Tuesday morning, Volkswagen Truck & Bus said it would buy a 16.6% stake in Navistar at a cost of $15.76 a share, a $256 million injection the company can use to manage its $5 billion debt load.

Volkswagen’s stock buy creates new liquidity for Navistar, but more importantly it serves as a major vote of confidence. The German automotive giant’s purchase comes with a joint procurement agreement that could reshape Navistar’s supply chain, freeing up hundreds of millions of dollars in cost savings to give the ailing truck-maker newfound operational breathing room.

The procurement JV will put Navistar into Volkswagen’s truck parts buying network, which also includes big brands like Scania and Man. It will also give Navistar and Volkswagen increased buying heft as they invest in new powertrain technologies, and in-vehicle technologies such as advanced driver assistance systems, connected vehicle solutions, autonomous driving, electric vehicles, cabs and chassis.