San Diego Mayor Roger Hedgecock, 39, a moderate Republican leading the nation's eighth largest city, was convicted there today of conspiracy and perjury in connection with a scheme to funnel illegal contributions to his winning 1983 campaign.

Under state law and the city charter, Hedgecock must resign his office, to which he was reelected in November, when he is formally sentenced. He could be jailed for as many as eight years, but his attorney indicated the mayor will appeal and may be able to enter the special election that must be called to fill his unexpired term. Sentencing is set for Nov. 6.

A Superior Court jury of eight women and four men, the city's first sequestered jury in 10 years, returned the guilty verdict this afternoon after more than six days of deliberation in a San Diego hotel. Hedgecock sat with his hands folded on the desk before him and betrayed no emotion as the verdict was read.

Later, he said he was "terribly disappointed" with the verdict and "very grateful" for the support of his family and staff.

Hedgecock's conviction is the latest episode in a drama of financial intrigue, election maneuvering and personal enmity that has shaken San Diego and many of its best known citizens for nearly two years.

Much of the turmoil began with collapse of the financial empire of J. David (Jerry) Dominelli, a local business leader who cultivated the image of an investment genius with a social conscience but later confessed to swindling about 1,000 people out of $80 million.

Prosecutors charged that Dominelli and his partner, Nancy Hoover, funneled $361,500 into Hedgecock's 1983 campaign under the guise of investments in a new consulting firm in order to circumvent the city's $250 limit on individuals' political contributions.

The consulting firm was headed by Tom Shepard, a longtime Hedgecock associate who took the young mayoral candidate with a strong environmental record as his principal client. Shepard has been charged as a coconspirator.

Hedgecock argued that Dominelli invested in Shepard's firm as a favor to Shepard, not Hedgecock, and that he had no knowledge of any scheme to skirt campaign laws. But a local investment counselor testified that Hedgecock had boasted in 1981 that Dominelli was "going to invest sufficient funds" in Shepard's firm to fuel the campaign.

The jury found Hedgecock guilty of the conspiracy charge and 12 of the 14 felony perjury counts against him for what prosecutors said were deliberate omissions from political-disclosure forms he was required to file. He was acquitted of two perjury counts and a misdemeanor conflict-of-interest charge.

Until today, the charges and daily court appearances appeared to have had little impact on Hedgecock's political standing. He was elected in 1983 to fill the unexpired term of Pete Wilson, a Republican who had been elected to the U.S. Senate.

Most of San Diego's nearly 1 million residents seemed to applaud Hedgecock as a worthy practitioner of Wilson's brand of pragmatic, conservation-conscious politics.

Despite his indictment in September 1984, Hedgecock was reelected with 58 percent of the vote to a full four-year term seven weeks later. The district attorney's first case against him ended in a mistrial in February when sanitation supervisor Leon Crowder, 37, the only city employe on the jury, refused to vote for conviction.