Apple’s (AAPL) $1 billion investment in car-hailing app Didi Chuxing in May helped accelerate Uber‘s decision to agree a halt to a costly two-year battle with its rival in China, people close to the companies and analysts said.
Didi Chuxing Technology and Uber Technologies (UBER) raised billions of dollars in funding and spent heavily on discounted rides as they slugged it out for drivers, passengers and market share in the world’s second-biggest economy.
Uber finally ceded this week, realizing it was no match for a cash-rich rival with the backing of three of the world’s largest technology giants. It agreed to give up its independence in return for a nearly one-fifth stake in a bigger Didi.
Didi raised far more money than Uber China—making China the first market where Uber‘s strategy of outspending its chief competitor faltered, pushing it to surrender. Apple’s support for the Chinese firm made it clear it would be difficult to beat Didi just through funding.
“The Apple investment is one of the factors that influenced the decision,” said a person close to the companies, who couldn’t be named because the discussions were private. “Both sides raised enormous amounts of capital. They were probably thinking this was going to escalate to nuclear warfare, which raised the question: do we really want to assure mutual destruction?”
For more on Apple, watch this Fortune video:
Didi unveiled a $7.3 billion funding round in June from investors including Apple, China Life Insurance (LFC), Ant Financial and other new shareholders, giving the company a $28 billion valuation—making it the world’s third highest-valued venture-backed startup.
With backing from Chinese Internet giants Alibaba Group (BABA) and Tencent (TCEHY), Didi says it has $10.5 billion in available funds.
Uber CEO Travis Kalanick set out a year ago to woo investors, with a need to match Didi’s fundraising so it could also match its rival’s spending. In the end, Uber China raised more than $1.5 billion from China Life, state-owned banks, search giant Baidu (BIDU) and others, valuing it at about $8 billion. It also counted on funds from Uber Technologies in the U.S.
Uber says it is profitable in the United States, Canada and about 100 cities, and used those earnings to subsidize its China operations. Didi says Uber China made less than $60 million in net profit last year.
As recently as June, Uber was hoping its rapid growth in China would help it overtake Didi by 2017. In a March interview with Reuters, Kalanick rebuffed talk that Uber was considering a sale of its China business, and said he was committed to the country for the long term.
Didi and Uber discussed a potential combination at least five times and started actively pursuing a deal about three months ago, investors familiar with that process and advisers to the companies said. The eventual deal offered Uber a way to raise $1 billion and keep its $62.5 billion valuation.
Bill Gurley, a partner at Benchmark Capital and Uber board member, said Uber was never financially stressed in China: “Capital raising was never the issue,” he said. “There has never been a company with as much success in capital raising as Uber.”
Still, in May, around the time talks began in earnest between Uber and Didi, Apple announced its $1 billion investment in Didi—reinforcing Uber‘s belief it was going to be too difficult to beat its rival, according to three people familiar with the deal, with huge corporate investors lining up behind Didi.
“With Apple’s investment it became even more difficult for Uber to raise money,” said Hans Tung, managing partner at GGV Capital, which backed Didi.
See also: So Much For the Anti-Uber Alliance
Apple’s announcement coincided with a meeting Kalanick had planned that week at Apple headquarters. It’s unclear who that meeting was with or what it was about.
“Apple’s investment in Didi likely spurred Uber to think harder about doing some kind of deal here,” said Jan Dawson, an Uber analyst at Jackdaw Research. “Uber and Apple have been partners in other markets, so for Apple to side with Didi must have been something of a red flag that things weren’t going to go Uber‘s way.”
Apple and Uber have some relationships—Uber passengers can pay with Apple Pay, and Uber provides its drivers with iPhones. But Uber has been eager to nail down a deeper partnership with Apple, according to some investors.
Now that Uber is aligned with Didi, Tung said, opportunities may open up for such a partnership.