McLaren are to split with engine partner Honda at the end of the season just three years into their troubled partnership.
It follows consistently poor performance and reliability from Honda's engines since the two joined forces for the 2015 season.
McLaren are to switch to Renault engines, having concluded a three-year deal, while Honda are moving to Toro Rosso.
In addition, Renault have announced that Carlos Sainz, who drives for Toro Rosso this season, will join them next year.
And Fernando Alonso is close to agreeing a new deal to stay at McLaren in 2018, prolonging the two-time champion's F1 career and giving the Spaniard the opportunity to end his career on a relative high.
In a related but separate development, it emerged on Thursday that Red Bull are set to split with Renault at the end of 2018, after the French car company told them they would not be extending their contract, after years of antagonism between the two partners.
How, and why, did it all happen?
The engine deals and Sainz's contract were interlinked with each other. The complex deal has taken months to put together and has included input not only from the bosses of the companies involved, but also F1's governing body the FIA and commercial rights holders the F1 Group.
Sainz's switch to Renault was a part of the deal that allowed Toro Rosso to end its contract with the French manufacturer and work with Honda, which most in F1 were keen to keep in the sport despite the failure of the McLaren partnership.
And Alonso's future in F1 was effectively dependent upon McLaren dumping Honda. Both team and driver had lost faith in the Japanese company's ability to turn around their competitiveness within a timeframe acceptable to them.
Splitting with Honda is a calculated gamble by McLaren, because the car company contributed about a net $100m (£75m) to the team through free engines, sponsorship funding and paying half the drivers' salaries.
But McLaren decided that their continued poor performance as a result of the shortfall in the Honda engine was putting the future of the team at risk, affecting their income both in terms of prize money from F1 and making them unappealing to sponsors, and reducing their appeal to leading drivers.
- Read: Daniel Ricciardo supreme for Red Bull as Ferrari struggle
- Read: When F1 partnerships go wrong
- Read: Carlos Sainz to join Renault in 2018
McLaren Group executive chairman Shaikh Mohammed bin Essa Al Khalifa said: "Honda is a great company which, like McLaren, is in Formula 1 to win. Although our partnership has not produced the desired success, that does not diminish the great history our two companies have enjoyed together, nor our continued efforts to achieve success in Formula 1.
"At this point in time, it is in the best interests of both companies that we pursue our racing ambitions separately."
Honda president Takahiro Hachigo described the split as "unfortunate" but added that it was "the best course of action for each other's future".
Renault Sport president Jerome Stoll described joining forces with McLaren as a "strategic decision", adding: "This alliance is not only technical and sporting, but also comes with marketing and communication benefits. We know that McLaren will push us hard on track and this competition will be to the benefit of all."
Shaikh Mohammed said: "At McLaren, we have the motivation, the desire and the resource to be a competitive force in 2018; now Renault power gives us the ability to take a significant step further up the grid."
What about Red Bull and Honda?
Red Bull's strategy in securing Honda engines for its junior team is that if one day the engines become competitive, the supply can be switched to the senior team which would then become Honda's factory partner.
This is a better scenario for them than their current customer relationship with Renault, which has been troubled as a result of Red Bull's frustration with the engine's inability to match the standard-setting Mercedes since the dawn of F1's turbo hybrid era in 2014.
That ended four years of domination by Red Bull from 2010-13, founded on the teams excellence in aerodynamics at a time when engine parity was guaranteed by the rules.
Hachigo said Honda was "excited" to work with Toro Rosso, whose team boss Franz Todt said he had "full confidence in Honda's capabilities to succeed".
As things stand, Honda look set to supply both Red Bull teams in 2019.
Renault have told Red Bull they have no intention of extending their contract beyond the end of next season, the result of an often bitter relationship between the two parties.
The situation is complicated by a commitment Renault has made to F1 that it would supply Red Bull if the team ever found themselves without an engine.
But sources say the most likely scenario is that Renault and Red Bull will not be working together after 2018.
In the meantime, Renault Sport F1 managing director Cyril Abiteboul said he was "looking forward interesting racing next year between all Renault-powered cars" next year.
The company's engines will power the cars of its own works team, as well as Red Bull and McLaren in 2018.