With nearly 7 million ballots counted, Democrat Kamala Harris holds a razor-thin lead over Republican Steve Cooley in the race for state attorney general.

Fewer than 38,000 votes separate the two candidates as thousands of late absentee and provisional ballots remain uncounted. Cooley, the Los Angeles County district attorney, jumped out to an early lead as the votes were being counted across the state Tuesday night.

Cooley declared victory and scheduled a victory press conference for Wednesday morning. But as the race tightened, Cooley's campaign announced he was canceling the press conference until the race had a more definitive result.

Harris, who trailed in most public opinion polls leading up to election day, is trying to complete a Democratic sweep of statewide offices. All other statewide offices went to Democrats, including the three currently held by Republicans -- governor, lieutenant governor and insurance commissioner.

"Steve Cooley, who declared victory and went home, should be up biting his nails," state Sen. Mark Leno (D-San Francsico) said shortly before 1 a.m. to a dwindling crowd of Harris backers in San Francisco. "It's going to be a story long into tomorrow, but my own assessment and opinion is, we win this race!"

If her victory holds, Harris would become the first African American and first woman ever to hold the job of California attorney general. Cooley ran on a strong law-and-order message, while Harris emphasized environmental protection in her campaign. Harris proved to be a prodigious fundraiser, and received campaign help from President Obama in the closing weeks of the campaign.

--Anthony York