British driver George Russell will replace Lewis Hamilton for this weekend's Sakhir Grand Prix.
Seven-time world champion Hamilton, 35, was ruled out of the penultimate round of the season in Bahrain after contracting coronavirus.
Russell, 22, is a member of the Mercedes junior driver programme and when it became clear Hamilton would not be able to race, the world champions contacted Williams about striking a deal.
"Very few people are lucky enough to drive for an F1 team each year and I'm about to get the chance to drive for two," said Russell.
"Unbelievably grateful to Williams and Mercedes for this opportunity."
Another Englishman, Jack Aitken, will now take Russell's regular seat at Williams for his F1 debut.
"I can't believe this, but I will make my F1 debut with Williams this weekend," the 25-year-old Williams reserve driver said.
"Huge thank you to them, and obviously my best wishes to Lewis, and George making the step into the Mercedes."
Russell, from King's Lynn, Norfolk, will now have the chance to prove his credentials by stepping into the fastest car on the grid.
The highly-rated Englishman is in his second season in the sport, but has yet to score a single point in his uncompetitive Williams machinery.
Remarkably, he will now be among the favourites to win at Bahrain's outer loop layout on Sunday.
He becomes only the third British driver to race for Mercedes, following in the footsteps of Sir Stirling Moss and Hamilton.
"I wish to thank our loyal partners at Williams for their collaboration and open-mindedness in making it possible for George to race for Mercedes this weekend," said team principal Toto Wolff.
"The conversations with the team at Williams were positive and pragmatic, and those were the key factors in reaching an agreement.
"It will not be a straightforward task for George to make the transition from Williams, but he is race-ready and has detailed understanding of the 2020 tyres and how they perform on this generation of cars.
"George has shown impressive form this year with Williams, playing an instrumental role in their climb up the grid, and I am optimistic that he will deliver a strong performance alongside Valtteri Bottas, who will be a demanding reference for him.
"Our thoughts are also with Lewis, and we will be supporting him as much as we can to make a rapid recovery during his period of self-isolation."
Russell could also drive for Mercedes at next weekend's Abu Dhabi Grand Prix with Hamilton's participation at the season finale in doubt.
Hamilton is in quarantine for 10 days in Bahrain after he tested positive for coronavirus on Monday.
Russell, who is in the second of a three-year deal with Williams, added: "Obviously, nobody can replace Lewis, but I'll give my all for the team in his absence from the moment I step in the car.
"Most importantly, I wish him a speedy recovery.
"I might be wearing a different race suit this weekend, but I'm a Williams driver and I'll be cheering my team on every step of the way.
"I see this as a great chance to learn from the best outfit on the grid right now and to come back as an improved driver, with even more energy and experience to help push Williams further up the grid.
"A big thank you also to Mercedes for putting their faith in me."