Republican hopes of winning the Louisiana governorship for the first time since Reconstruction have been kept alive with a narrow primary victory by Rep. David Treen over five major Democratic opponents.

With all but a handful of ballots counted from Saturday's election, Treen, a conservative Republican, had collected 21.8 percent of the vote in this state's first open primary, which put members of both parties on the same ballot.

Lt. Gov. James E. Fitzmorris finished second in unofficial returns with 20.6 percent of the vote in what may be the most costly state election in U.S. history. Fitzmorris, 57, will now meet Treen, 51, in a Dec. 8 general election.

Public Service Commissioner Louis Lambert, who ran a $4 million "Populist" campaign, finished a surprisingly strong third, collecting 20.5 percent of the vote or just 1,988 ballots less than Fitzmorris. He was followed by Secretary of State Paul Hardy with 15.5 percent, state House Speaker E. L. (Bubba) Henry with 9.9 percent and state Sen. Edgar (Sonny) Mouton with 9.1 percent. Minor candidates received the rest.

The six major candidates spent an estimated $20 million -- or more than $10 per registered voter -- in what may be the longest and most intensive television campaign ever waged in the nation. The candidates began their TV commericials in February and have been going full blast ever since, leading observers to label this "the year of the TV governor." Voters apparently rose to the occasion, with more than 70 percent of registered voters turning out at the polls.

Treen, who has represented a congressional district that includes suburban New Orleans since 1972, had held comfortable leads in public opinion polls for months and was expected to win by a larger margin than he did. In a state where only 5 percent of the voters register as Republicans, he will go into the general election as a slight underdog.

"This is not any time to be boastful; it's a time to be thankful -- and that's what I am," Treen told supporters crowding a hotel ballroom early today.

The race will assure Louisiana of its first governor from the New Orleans area since 1850. Fitzmorris, who became known as "Mr. Scissors" for his frequent ribbon-cutting activities as lieutenant governor, was a New Orleans city councilman for 12 years and an unsuccessful candidate for mayor twice.

He had the strong support of New Orleans Mayor Ernest (Dutch) Morial in the primary, and waged a noncontroversial campaign, avoiding direct attacks on fellow Democrats. He will be an easy figure for Democrats and organized labor to rally around. In addition, public opinion polls have shown him to be the strongest candidate against Treen.

Fitzmorris said Treen's advantage as the only Republican against a field of Democrats in the open primary would be removed in the general election. He asked the losing Democrats to support him Dec. 8.

"I would suppose that you would find a lot of Democrats pulling together," Fitzmorris said. "I believe in the two-party system.I believe that's good. I believe you will see Democrats getting solidly behind the Democratic candidate and the Republican people getting behind the Republican candidate."

Treen downplayed both his conservatism and Republicanism in the primary. "He's the only candidate in America to move to the left this year," said Mark Shields, a Washington-based political consultant who worked for Henry's campaign.

"In a state where 95 percent of the people register as Democrats you don't go around emphasizing that you are a Republican," Treen said in an interview. He said the difference between state issues and national ones made him appear more moderate in this race than he has in the past.

"I'm opposed, for instance, to federal grants for elementary said secondary education," he said. "I think this is a state function. So I would have to be considered conservative, a radical right-winger on the national level, but I would be perceived as very liberal on the state level."