Germany's Nick Heidfeld will race for Williams this season alongside Australian Mark Webber, the Formula One team said on Monday.
Heidfeld had been up against Brazilian Antonio Pizzonia for the best seat still available on the starting grid.
After weeks of uncertainty, the BMW-powered team announced its decision at the unveiling of its 2005 car in Valencia, Spain.
"We have decided, at the last minute, that Nick Heidfeld would be the team's regular driver," said Frank Williams. Pizzonia will be the team's test driver.
The decision gives Heidfeld, who raced for Jordan last season after spells at now-defunct Prost and Sauber, a real chance of winning races with a team that triumphed in the last grand prix of 2004.
"I really wanted this job," said Heidfeld. "Driving for the BMW WilliamsF1 team is the greatest oppportunity of my career."
The completion of Williams' driver lineup leaves just three teams with vacancies.
Jordan, taken over by Midland last week, have yet to announce any drivers while Minardi and Red Bull Racing both have yet to name their second drivers.
The season starts in Australia on March 6.