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

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

PIF, which already has stakes in McLaren and Lucid, now owns 16.7 percent of Aston, making it the second largest shareholder. Only chairman Lawrence Stroll, who has an 18.3 percent stake, holds a bigger slice of the Aston pie. Mercedes-Benz, previously the second-largest shareholder, will see its stake fall from 11.7 percent to 9.7 percent as a result of the rights issue, though Autocar reports that Benz will invest an additional £56 million ($67 m) to recover ground.

Aston Martin has struggled intermittently throughout its 109-year life and has been bankrupt multiple times. The company’s shares have fallen almost 73 percent this year, and it was saddled with £957 million ($1.14 m) of debt at the end of March. Aston will use its newfound riches to repay debt and invest in future products. Those new products will include the company’s first EV, 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 Sounds Insane

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, the restoration of the business and balance sheet we inherited, and the acceleration of our long-term growth potential,” Aston chairman Lawrence Stroll said.

“It transforms our balance sheet, liquidity and cashflow profile and provides greater clarity on our pathway to become sustainably free cash flow positive and create significant shareholder value.”

One other Aston revelation to come out today is the news that the company rejected a £1.3 billion ($1.55 bn) investment offer from Atlas Consortium, and group consisting of Chinese company Geely and Investindustrial, which owns Morgan, suggesting the deal would have been bad for existing shareholders.