Former governor George C. Wallace kept his political comeback alive by winning a close, hard-fought victory over Lt. Gov. George McMillan in the Alabama Democratic gubernatorial runoff tonight.

With virtually all of the precincts reporting Wallace had 51.5 percent of the vote to 48.5 percent for McMillan, a Birmingham attorney and self-styled "New South progressive." Wallace took a narrow early lead right from the start and held it throughout the vote count.

As rebel yells bounced off Wallace headquarters in a converted furniture warehouse here tonight, Wallace declared victory from a makeshift stage, his third wife, Lisa, 32, clutching his hand, supporters waving Wallace signs and standing on tiptoes to glimpse a legend. She was crying. "I'm very humbled by this win," he said, thanking "blacks and whites" for rallying to his side.

The two candidates waged a hard-fought and sometimes bitter campaign that was haunted by the racial politics of Wallace's past and was judged too close to call by the pollsters when the voting booths opened this morning.

Wallace, 63, was running for an unprecedented but non-consecutive fourth term, and was fighting his history as a segregationist governor. His political survival depended heavily on winning a large share of Alabama's black voters, who make up nearly 30 percent of the population.

Wallace tried to persuade them to forget his past and to convince them that he would be the most effective in reducing the state's high unemployment.

He ran strong in some black counties and in Mobile, but McMillan beat him by about 2 to 1 in Birmingham, Montgomery and Huntsville, the other three metropolitan areas.

Wallace ran for president in 1964, 1968 and 1972, but, after a four-year absence from politics, he returned, campaigning as the candidate of the "average man and woman, black and white."

Wallace finished ahead of McMillan, 42 to 29 percent, in the five-man primary on Sept. 7, but all the polls indicated that McMillan had closed to almost even by election day.

McMillan, 38, however, also was fighting history. No Alabama lieutenant governor has jumped directly into the governor's seat since 1918, and no candidate has won a Democratic primary runoff after finishing second by a large margin -- except Wallace in 1970 against Lt. Gov. Albert Brewer. Wallace now faces Montgomery's Republican mayor, Emory Folmer, on Nov. 2.

"This race is so fluid and volatile it cannot be called," said Natalie Davis, a political science professor and pollster at Birmingham Southern University, about the campaign that ended today. "Like the politicians say, the only poll that counts will be the one at the ballot box."

At his victory celebration tonight, Wallace tore into Folmar for hosting former president Gerald R. Ford at a "$1,000-a-couple" fund-raiser on the eve of the runoff "when people in this state are doing without food and without jobs and going hungry. I don't think they Republicans are going to be running Alabama for the next four years."

It was a tense, down-to-the-wire contest, with worried Wallace strategists like Mickey Griffin desperate for word from Birmingham's vote-rich suburbs in Jefferson County, McMillan's home turf, where 26 percent of the state's voters reside. Then it came in: Wallace had cut his losses. There were not enough votes left to give McMillan an upset.

"I was nervous as a cat," Griffin sighed, "but we just kicked a--. This just proves McMillan didn't get the black vote he needed."

The black vote was crucial to Wallace, who has been paralyzed from the waist down and has been confined to a wheelchair since he was gunned down by a would-be assassin in Laurel, Md., during his ill-fated 1972 presidential campaign.

He stunned black leaders who had endorsed McMillan by winning about one-third of the black vote and carrying every majority black county except one in the primary by preaching a populist litany of jobs, forgiveness and a return to better times.

He promised to be "governor of all the people." He campaigned as the man who could put the unemployed back to work and who could use his influence as an internationally known politician who could lure foreign industry into Alabama.

He saturated black population areas with this message by radio and at church meetings while the civil rights establishment leaders sat on their hands until late in the campaign.

"The black vote is very crucial," Davis said. "McMillan can't win with white votes alone, and Wallace can't win without a portion of the black vote. It's all tied to turnout."

In the final days of the campaign McMillan's black supporters took aim at that support. They brought in black leaders such as Coretta King, wife of slain civil rights leader Rev. Martin Luther King Jr., and the Rev. Jesse Jackson to urge blacks to vote against Wallace, who once vowed to stand in the schoolhouse door to prevent desegregation.

But Wallace supporters said they believed the heavy media coverage of Jackson would antagonize whites and boomerang in their favor.

Many rural blacks who support Wallace resented the attacks.

"We don't need outside agitators coming in telling us how to vote," bristled Frank Mastin Sr., 69, a retired truck driver.

Wallace has tried to portray McMillan, a Birmingham lawyer, as a liberal who is for the Equal Rights Amendment, pro-abortion and anti-school prayer. McMillan, with a superior campaign organization, has hammered at Wallace's "negative politics of the past."

It came down to a classic urban-rural Alabama fight, with Wallace appealing to poor farmers and blue-collar workers, unemployed steelworkers and rural blacks: those who are suffering most from the state's 14.2 percent unemployment rate, second only to Michigan's.

Wallace also tried to woo former supporters who had defected to conservative house Speaker Joe McQuorquodale, who finished third in the primary with 25 percent. Many were concerned about Wallace's health.

But Wallace hammered away at such concerns, as he did on election eve at a rally here attended by 2,500 supporters, many with calloused hands and empty wallets. They pasted "Wallace" stickers on their blue jeans and crowded onto Patterson Field to eat $1 hot dogs, hear country singer Tammy Wynette sing "Stand By Your Man" and listen to "Governor George."

"You don't govern Alabama with your legs, but with your head," he rasped. "Trouble with this country is we've had too many politicians in Washington, D.C., who are paralyzed in the head. That won't ever happen to me."