Aston Martin’s future has been secured following the announcement of an investment deal with a Saudi sovereign wealth fund.

Saudi Arabia’s Public Investment Fund (PIF) is investing £78m ($93m) in the cash-strapped luxury car brand in exchange for a large stake in the company and two seats in the board of directors. The combination of the cash injection from the PIF and a £575m ($685m) rights issue is expected to bring in a total of £653m ($773m) for Aston Martin.

PIF, which already has stakes in McLaren and Lucid, now owns 16.7% of Aston, making it the second largest shareholder. Only chairman Lawrence Stroll, who has an 18.3% stake, has a bigger slice of the Aston pie. Mercedes-Benz, previously the second-largest shareholder, will see its stake drop from 11.7% to 9.7% following the rights issue, yet Coach reports that Benz will invest an additional £56m ($67m) to reclaim land.

Aston Martin has struggled intermittently throughout its 109-year life and has repeatedly gone bankrupt. Shares in the company have fallen nearly 73% this year, and it was saddled with £957 million ($1.14 million) of debt at the end of March. Aston will use its new wealth to pay down debt and invest in future products. These new products will include the company’s first electric vehicle, which will be based on a Mercedes platform and running gear, and is expected to launch in 2025.

Related: The Aston Martin Valkyrie AMR Pro Looks Crazy

Aston’s second largest shareholder, PIF, also has stakes in Lucid and McLaren

“Today’s announcement marks the latest success in the evolution of Aston Martin, restoring the business and balance sheet we have inherited, and accelerating our long-term growth potential,” said Aston chairman Lawrence Stroll.

“This transforms our balance sheet, liquidity and cash flow profile and further clarifies our path to becoming sustainably free cash flow positive and creating meaningful shareholder value.”

Another revelation from Aston to come out today is news that the company has rejected a £1.3 billion ($1.55 billion) investment offer from Atlas Consortium and a group made up of from Chinese company Geely and Investindustrial, owner of Morgan, suggesting the deal would have been bad for existing shareholders.