Former prime minister Ian Smith, capitalizing on white resentment of the black-majority government here, was reelected to Parliament today by an overwhelming margin in a whites-only election.

Early returns in the special poll gave four seats to Smith's conservative political party, four to his principal opponents and one to an independent also opposed to his hard-line policies, with 11 seats still to be decided. The results reflected the deep divisions among the country's small and uneasy white population between Smith's confrontational stance toward Prime Minister Robert Mugabe's socialist-oriented government and the more conciliatory approach of the moderates.

Smith won 71 percent of the vote in a parliamentary district here in Zimbabwe's second-largest city. He hailed his victory as "the first step in the right direction of bringing a little bit of sanity to the scene . . . ."

But two of Smith's principal white opponents -- William Irvine, leader of the Independent Zimbabwe Group, and Chris Andersen, one of two white ministers in Mugabe's Cabinet -- also were reelected. The two men led the walkout from Smith's party three years ago that was the first split within the white parliamentary delegation.

Smith, who led this country, then known as Rhodesia, during 14 years of white-minority rule in defiance of international law, made a strong, emotional appeal to the anxieties of the 32,500 registered white voters. Many of them fear and resent Mugabe's Marxist rhetoric and variable policies.

In recent days Smith, who has said this will be his last campaign, drew large and enthusiastic crowds here and in the capital of Harare. He lashed out against Mugabe and against his white opponents, whom he accused of disloyalty for breaking ranks with him in 1982.

Under a complex 1979 agreement that helped pave the way to black-majority rule, 20 of Zimbabwe's 100 parliamentary seats are set aside for whites, despite the fact they constitute less than 2 percent of the population. The agreement expires in 1987, and at that time 70 parliamentary votes will be sufficient to abolish or alter the arrangement.

The country's 2.9 million black voters go to the polls Monday and Tuesday to choose the 80 other legislators in an election Mugabe's party is considered almost certain to win.

Smith said tonight that he hoped Mugabe could be persuaded not to abolish the white roll, but he sounded a confrontational note that is likely to antagonize the black leader further.

"I hope they will listen to us," he said of Mugabe's government. "If they have any intelligence they will, if they want to keep our brains, our skills."

Smith won all 20 white seats in the 1980 vote prior to independence, but defections and interim elections have eroded his party's delegation to seven seats.

He started this campaign emphasizing his desire to "reunite" the white community and to work together with Mugabe and other black leaders. But in recent days his attacks grew more pointed, his descriptions of Rhodesia's white-ruled past more evocative and his crowds larger.

He contended that Mugabe's "communist" government had allowed schools, health care, the economy and law and order to deteriorate seriously and was "doing damage to our country" in advocating a one-party state.

More than half the white population has left Zimbabwe since independence, leaving about 100,000.