LOS ANGELES — A former Republican congressman narrowly beat his Democratic rival early Wednesday for the right to fill the House seat once held by imprisoned Randy "Duke" Cunningham, a race closely watched as a possible early barometer of next fall's vote.

Republican Brian Bilbray emerged victorious after a costly and contentious race against Democrat Francine Busby, a local school board member who ran against Cunningham in 2004.

"I think that we're going back to Washington," Bilbray told a cheering crowd of supporters.

The race — one of dozens of election contests in eight states -- was viewed by Democrats as an opportunity to capture a solidly Republican district and build momentum on their hopes to capture control of the House.

Westly, a former eBay executive, poured $35 million of his own money into the campaign, but was unable to overcome the labor unions that turned out the vote for Angelides. A low turnout made the unions’ efforts all the more important.

Votes still being countedElsewhere, Alabama Gov. Bob Riley easily beat back a GOP primary challenge from Ten Commandments judge Roy Moore, while Democratic former Gov. Don Siegelman — who campaigned while on trial on corruption charges — lost his comeback fight against the state’s first female lieutenant governor. Also in Alabama, voters passed a ban on gay marriage by a 4-to-1 margin.

Riley said voters saw state government has changed while he has been in office. “People appreciated the difference in the level of corruption we had in the past and the corruption we don’t have today,” he said. His challenger, Moore, said: “God’s will has been done.”

Another Washington corruption case figured in Montana’s primary, where GOP Sen. Conrad Burns sought the nomination for a fourth term. After his ties to disgraced lobbyist Jack Abramoff became known, Burns saw his popularity fall. He beat several primary challengers and won nearly three-quarters of the vote. His Democratic challenger in the fall will be state Senate President Jon Tester.

In Iowa, the retirement of two-term Democratic Gov. Tom Vilsack set off a wide-open race. Secretary of State Chet Culver will face GOP Rep. Jim Nussle in the fall.

Mississippi, Montana, New Mexico and South Dakota also held primaries. Corruption and allegations of corruption — in California, Alabama and Montana — crisscrossed the country. Immigration was a campaign issue from the South to the Plains.

Immigration at center of campaignStill, the biggest race was the one to replace Cunningham, who was sentenced to eight years in prison for taking bribes on a scale unparalleled in the history of Congress.

National Democrats spent nearly $2 million on the race; the GOP spent $4.5 million. President Bush and first lady Laura Bush recorded telephone messages for Bilbray, while the Democrats’ last two presidential candidates — John Kerry and Al Gore — urged supporters to back Busby.

Bilbray, made immigration the centerpiece of his campaign, proposing a fence “from the Pacific Ocean to the Gulf of Mexico” and restrictions to keep illegal immigrants from collecting Social Security and other benefits.

Busby, a local school board member, focused her campaign on public dissatisfaction with the Bush administration and the GOP-led Congress, and assailed Bilbray for working as a lobbyist in Washington. She consistently referred to him as “the lobbyist Bilbray.”

In New Jersey, Republicans chose Tom Kean Jr., the son of a popular former governor, to challenge Democratic Sen. Robert Menendez in the fall.

In the weeks leading up to Alabama’s gubernatorial primary, polls showed Riley with a growing lead on Moore, the former state chief justice who became a hero to the religious right in 2003 when he was ousted over his refusal to remove the Commandments monument from the state judicial building.

Lt. Gov. Lucy Baxley fashioned an “I Love Lucy” campaign, while Siegelman had to campaign at night while on trial on corruption charges during the day. She won with 60 percent of the vote while Siegelman got just 36 percent. Riley took 67 percent of the vote, and Moore 33 percent.

A few races brought back some familiar names:

Jerry Brown — the former California governor, presidential candidate and current Oakland mayor — won the Democratic primary for attorney general.

George C. Wallace Jr., son of the former Alabama governor, trailed in the GOP primary for lieutenant governor to attorney Luther Strange but the race goes to a runoff because no one got 50 percent.

Hollywood director Rob Reiner was the leading backer of a measure in California to create a $2.4 billion universal preschool program, which went down to defeat by a 60-to-40-percent margin.