The stunning coup, hatched overnight by Mr Lafontaine after a rousing speech at the SPD's conference in Mannheim, sent shivers down the spines of conservative politicians in Bonn. Helmut Kohl's Christian Democrats, 14 points ahead in the latest polls, now face an energised opposition no longer dragged down by a leader devoid of ideas and charisma.
Until yesterday morning, Mr Scharping stood unchallenged for the post of chairman. Then, as fate would have it, he it was who had to convey the news of his imminent demise: "I asked Oskar if he was going to be a candidate," Mr Scharping told the hushed audience. "Oskar answered my question by saying he would run."
The announcement brought the roof down, rewarding Mr Scharping with the first real table-thumping ovation at a conference already into its third day. The party really took off an hour later, when the result of the ballot was read out. Mr Scharping, his pallid features turning ever paler, seemed to be choking back tears as his popularity within the party he has led for two years was enumerated. Mr Lafontaine, who led the party's unsuccessful electoral challenge to Mr Kohl in 1990, had received 321 votes; Mr Scharping, defeated by Mr Kohl last year, a derisory 190.
"I was of the view that we needed clarity," Mr Scharping muttered. "Now we have it."
The new leader faces the task of uniting Social Democrats behind policies that can challenge the conservative hegemony. After a series of regional- election setbacks, the party has plunged to its lowest poll rating since the war. Although Mr Lafontaine has only won a two-year term, his role in preparing the Social Democrats for the 1998 general elections will be crucial. "I am aware of my responsibilities and depend on all of you to support me," he said in his victory speech.
If charisma were all they needed, the Social Democrats would be home and dry. Mr Lafontaine, the 52-year-old prime minister of Saarland, has bags of wit and charm, and a populist touch that few can match. He also has quite a reputation as a bon viveur.
In 1992 Saarland's parliament discovered that he was paying himself a state pension, at the age of 48, on top of his salary as prime minister. Mr Lafontaine was forced to spin a convoluted fable about cash flows and his high cost of living in order to escape censure.
His tastes might be expensive, but his origins and politics are humble. The son of working-class parents, the new SPD leader is on the left of the party, embodying the blue-collar values that are finding ever fainter echoes in the 1990s. As German industry migrates to rural regions in the south or exports jobs to cheaper countries in Europe, the ranks of the class-conscious working class are dwindling. Even in his native Saarland, Mr Lafontaine's most noted recent achievement is the profitable conversion of a derelict foundry into a theme park.
His leftist leanings have been seized upon by Mr Kohl's party as an electoral liability. "With the election of Oskar Lafontaine, the SPD is leaving the political centre ground," commented Peter Hintze, the Christian Democrats' general secretary.
But economic reality has tempered Mr Lafontaine's socialist zeal, and he has proved adept at toning down some of the rhetoric. In foreign affairs, he remains firmly on the left, however. His passionate argument against the use of German warplanes in the Bosnian peace-keeping mission earned him loud applause on Wednesday. Mr Lafontaine's misgivings about European monetary union were not so well received. As the Christian Democrats have warned, the new leader "will whip up passions" about the common currency, even in the teeth of bitter protests from the party's Euro-wing.
Whether he resorts to the populist tricks Mr Kohl fears remains to be seen. The SPD leader might have learned the lessons of the 1990 general elections, when his chauvinistic campaign against German reunification was swept aside by the voters. Mr Lafontaine, then the SPD's candidate against Mr Kohl, added up the sums and proclaimed that East Germany would cost a lot more to West German tax-payers than the conservatives were admitting. Ultimately, he was proved right, but that was long after Mr Kohl romped home in triumph.
The memories of that fatal misjudgement of the nation's mood are still vivid. After 13 years in the wilderness, the Social Democrats would be loath to suffer another defeat in three years' time and are therefore keeping their options about Mr Kohl's next challenger open.
That task may yet fall to Gerhard Schroder, the strutting prime minister of Lower Saxony, who does not disguise his burning ambition to take on Mr Kohl. Whether he gets the chance or not, from now on the going will get a lot tougher for the Chancellor, and life in the SPD will be a lot more interesting.