In a crucial victory for Britain's year-old Social Democratic Party, Roy Jenkins, who is expected to become leader of a centrist alliance and its candidate for prime minister, won a hard-fought special election yesterday for a vacant seat in Parliament from the Glasgow constituency of Hillhead.

Overcoming a concerted campaign by Britain's two traditional major parties to derail the Social Democrats and their allies, the Liberals, by keeping him out of Parliament, Jenkins, 61, won 33.4 percent of the vote to defeat seven opponents by a surprisingly wide margin.

The candidate of Prime Minister Margaret Thatcher's ruling Conservatives, 31-year-old local lawyer Gerry Malone, finished a distant second with 26.6 percent of the vote in a constituency controlled by the Conservatives for 64 years, the last 33 by Sir Thomas Galbraith, who died earlier this year.

It was the third consecutive loss of a previously Conservative seat to the centrist alliance of Social Democrats and Liberals. Jenkins' triumph reversed a recent decline in alliance support in public opinion polls, while Malone's loss negated a comeback in the polls by Thatcher's Conservatives.

Despite the unpopularity of her government's economic policies, the ideologically divided major opposition Labor Party continued its poor showing in special elections for vacant parliamentary seats. Its candidate, 34-year-old Glasgow community worker David Wiseman, finished third in yesterday's voting with 25.9 percent of the vote.

George Leslie, a 45-year-old veterinarian running for the fading Scottish Nationalist Party, won 11.3 percent, while the rest went to four minor candidates.

"The outcome is a triumph for the new deal of sense, moderation and hope" he had offered Hillhead voters, Jenkins said after the vote count was completed early this morning. "The result matches our highest expectations. This is a magnificent first birthday present for the Social Democratic Party," which was founded a year ago today.

According to numerous opinion polls taken in the hillside constituency of middle-class homes and working-class tenements along the Clyde River on the western side of Scotland's largest city, Jenkins converted many voters to his cause late in the three-week campaign. Earlier, he appeared to be having difficulty persuading them to support a Welsh-born English politician who once was deputy leader of the Labor Party.

But a fifth of Hillhead's voters turned out for nightly public meetings at which they heard Jenkins, other leading Social Democrats and Liberal leader David Steel argue that Britain needs a centrist political alternative to Thatcher's right-wing leadership of the Conservatives and Labor's shift leftward to more militant socialism.

"It has been a difficult campaign," another prominent Social Democrat, Shirley Williams, said earlier this week. "It was hard to shift this electorate, but I think the meetings changed people's minds."

Williams, who like Jenkins is a former Labor Cabinet minister, was the first Social Democrat elected to Parliament in a dramatic special election last November in Crosby outside Liverpool. Earlier, a relatively unknown Liberal, William Pitt, won a parliamentary seat in suburban London for the Social Democratic-Liberal alliance, and Jenkins won a surprising 42 percent of the vote in narrowly failing to win a safe Labor seat in Warrington in northern England.

Jenkins' victory gives the Social Democrats 29 members in the House of Commons, including 26 defectors from Labor, one from the Conservatives, and two elected as Social Democrats. With Pitt, the Liberals have 12, giving the Social Democratic-Liberal alliance a postwar record for a third political grouping of 41 parliamentary seats. There are 333 Conservatives in Parliament, 242 Labor members, and 16 representatives of regional parties, including two Scottish Nationalists.

Until regaining a parliamentary seat, Jenkins was unable to fulfill the expectation of many in the alliance that he would become leader of the Social Democrats and the eventual candidate for prime minister. While the Social Democrats have not decided yet how to choose their leader, Williams said this week that if Jenkins won today "it is absolutely certain he will lead the alliance."

After two decades in the House of Commons and two senior Cabinet posts in Labor governments, Jenkins left British politics to serve four years as administrative head of the European Community in Brussels. On his return, he was instrumental in both founding the Social Democrats and forming their alliance with the Liberals.

Rejecting both Labor's commitment to greater government control of the economy and Thatcher's free-market ideology, the centrist alliance supports maintenance of Britain's postwar mixed economy and welfare state with modestly increased government spending to create new jobs and some form of wage policy to hold down inflation. It seeks to change Britain's voting system to proportional representation to reduce governmental swings between what alliance leaders portray as extremes of right- and left-wing political philosophies rooted in Britain's traditional class conflict.

Critics accuse the alliance of designing vague policies to appeal to the widest range of voters as a "soft option" to the opposing radical approaches of Conservatives and Labor to Britain's severe economic problems. But Jenkins told Hillhead voters that Britain "needs a sense of moderation and hope in the middle of its political spectrum."