Sacramento physician Richard Pan has won the Democratic primary and Folsom attorney Andy Pugno the GOP nod in the 5th Assembly District.
With 91 percent of the vote counted, Pan's had 44 percent of the vote in the four-way Democratic contest. Pugno had 43 percent of the vote in a six-way Republican race.
The chance that Democrats could pick up the 5th Assembly District for the first time since 1978 drew big money from outside groups.
Pugno, who defended Proposition 8's ban on gay marriage as a member of its legal team, was among the better-known GOP candidates.
Among Democrats, Pan had the support of the California Medical Association.
Larry Miles, who is trailing Pan with 26 percent, was the target of smear mailers that appeared to be the work of deep-pocketed EdVoice, which advocates for charter schools.