SAN FRANCISCO, DEC. 8 -- Liberal Assemblyman Art Agnos was elected mayor today, defeating city Supervisor John Molinari for the right to run a city facing a massive budget deficit and a rising tide of AIDS patients.

With 429 precincts reported, or about 60 percent, Agnos had 71,316, or 69 percent, to Molinari's 30,895 votes, or 31 percent.

Agnos, a Democrat, was given a 3-to-1 edge in the polls over the Molinari, who described himself as a centrist.

The race to succeed Mayor Dianne Feinstein was expected to draw about 45 percent of the registered voters, about 173,000, despite heavy rain in the morning, said Jay Patterson, city registrar of voters.

By mid-afternoon, elections office spokesman Jim Kamenovsky said turnout appeared lower than anticipated.

The two candidates spent more than $3 million on a campaign in which they became the top two vote-getters in November balloting among a field of 11 candidates.

The victor succeeds Feinstein, who took over the mayor's office after the 1978 assassinations of Mayor George Moscone and Supervisor Harvey Milk. She was prohibited by law from seeking a third full term.

Both candidates were Democrats, but the four-year mayor's post is a nonpartisan position. Feinstein remains in office until Jan. 8.

The winner faces numerous city troubles, including a projected $87 million budget deficit, transit and parking problems and growing demands on the city's health care and social service systems due to the acquired immune deficiency syndrome epidemic ravaging the city's large homosexual community.

Molinari, considered heir-apparent to Feinstein, slipped steadily in popularity as his campaign took on a mudslinging image.

Meanwhile, Agnos, a former social worker, organized powerful and effective grass-roots support.

After Molinari gathered just 25 percent of the November vote compared with Agnos' 48 percent, several advisers and supporters urged him to drop out and spare the city the expense of a runoff for the post, which pays $112,084.

But he held his ground, and Molinari campaign manager Jack Davis said he hoped for "the biggest upset since Truman beat Dewey" in the 1948 presidential race, in which Dewey was favored.

Molinari and Agnos split over several key issues.