By ADAM NAGOURNEY

Published: June 8, 2006

The victory that Republicans squeezed out in a high-profile race to fill a Congressional vacancy here eased party anxieties Wednesday but signaled future difficulties as they confront tougher Democratic challenges in increasingly contested districts this fall.

The Republican candidate here, Brian P. Bilbray, won with 49 percent of the vote, defeating Francine Busby, the Democrat, who drew 45 percent, with the remaining votes going to an independent and a Libertarian, according to nearly complete returns.

Mr. Bilbray's failure to break 50 percent was striking. The Republican Party had poured workers and millions of dollars into avoiding defeat in a district where Republicans have a sizable registration advantage and where President Bush won by 10 percentage points in 2004. The previous holder of the seat, Randy Cunningham, who resigned after pleading guilty in a corruption scandal, defeated Ms. Busby in 2004 by 58 percent to 36 percent.

But if the outcome was worrisome to Republicans as they battle to hold control of the House, it was also a clear disappointment for Democrats. Despite a favorable set of local circumstances -- Mr. Cunningham's guilty plea, a rift among Republicans over how to handle illegal immigration and a divided field -- Ms. Busby failed to give her party the lift it was looking for in what had been the most watched race of the year.

Although she did better than when she ran in 2004 -- and in a district where registered Republicans outnumber Democrats by 44 percent to 29 percent -- her percentage of the vote was about the same as Senator John Kerry of Massachusetts received in the district in the presidential race two years ago.

''The fact that Busby got 15 points over Democratic registration, that should make Republicans nervous,'' said David McCuan, a professor of political science at Sonoma State University. ''It's not that Bilbray won. This is a safe Republican seat. I was very surprised that $5 million doesn't allow you to break 50 percent.''

The Republican Party backed Mr. Bilbray not just with money for advertising but also with automated phone calls from President Bush, Vice President Dick Cheney and Laura Bush and the highly sophisticated get-out-the-vote operation that has helped Republicans in the last two national elections. Analysts said Mr. Bilbray was also helped by a tough anti-immigrant message that resonated here on the Mexican border, all the more so after Ms. Busby was quoted in the final hours of the race as apparently countenancing the support of her campaign by illegal immigrants.

Yet the Republican victory also highlighted divisions within the party. In making immigration the central issue of the campaign, Mr. Bilbray publicly broke with Mr. Bush, who supports legislation that would allow some illegal immigrants to apply for citizenship. Mr. Bilbray, a former representative in another San Diego district, said in an interview that his campaign took off once he began attacking Mr. Bush and Senate Republicans for immigration legislation. He called for building a fence along the Mexico-California border.

''I said, 'Don't blame the House of Representatives and Brian Bilbray for the mistake that the Senate and the president were making,' '' Mr. Bilbray said. ''It made all the difference in the world.''

Republicans called the outcome a much-needed success during a difficult stretch. They noted that Mr. Bilbray won despite Democratic efforts to make corruption a central issue and also a sour environment for Mr. Bush, Congress and Republicans.

''I think a lot of critics were hoping that this would be a kind of bellwether so that they could say that the Republican Party and the presidency were in peril,'' said Tony Snow, the White House press secretary. ''Their hopes were clearly frustrated.''

Representative Thomas M. Reynolds of New York, the head of the National Republican Congressional Committee, described the results as a repudiation of the Democrats' effort, led by Representative Rahm Emanuel, the head of the Democratic campaign effort, to use corruption against Republicans. And Mr. Reynolds laughed at the notion that Democrats had won a moral victory.

''This is a major defeat for Rahm Emanuel and the Democrats, particularly with their culture of corruption message,'' he said, adding: ''There aren't any moral victories: You either win or you don't in this business.''

Mr. Emanuel, in an interview, said: ''They had to spend $5 million and the dominant message of immigration to break our message of change. It tells you how potent that message is. Not every district is going to be on the border of Mexico .''

Still, whatever disadvantages the Republicans had here, this is, with some notable exceptions, about as friendly ground as they are likely to find in the months ahead. This was never considered a truly contested district, and most of the districts where both parties are focusing their energy and money are less reliably Republican than this one.

Republicans will be hard-pressed to duplicate that expensive and elaborate campaign they waged for Mr. Bilbray in every district where an incumbent is under assault.

Of the 10 most competitive races for House seats now held by Republicans, as identified by the nonpartisan Cook Political Report, only 2 had Republican margins of victory in 2004 greater than the one posted by Mr. Cunningham here that year. Of those two, one is held by Representative Bob Ney of Ohio, who is under federal investigation in the Jack Abramoff lobbying scandal, and the other by Representative Jim Kolbe of Arizona, who is retiring.

Yet the result in the California race underscored a persistent concern among Democrats that their hopes of winning control of the House could be thwarted by Republican institutional advantages.

Republicans demonstrated yet again their ability to raise more money than Democrats and to deploy the get-out-the-vote and absentee-vote operation developed by the Republican National Committee.

The committee's chairman, Ken Mehlman, said Wednesday that Republicans had 160 people in this district helping to get out the vote.

''They made 164,000 phone calls,'' Mr. Mehlman said.

Democrats said the Democratic National Committee had no similar effort on the ground here.

Mr. Mehlman said the victory also ''showed the importance of turnout and the power of grass roots.''

Asked whether he would be satisfied with a result in which a Republican incumbent failed to break 50 percent, Mr. Mehlman responded: ''This is a very challenging environment. Nevertheless, he was able to hang on to the district.''

Mr. Bilbray contrasted the efforts by the party to his losing his seat in a neighboring district in 2000.

''I saw in 2000 when the Democrats came in with the big-labor bosses and just pummeled me and there was no help from any of the party people,'' he said. ''This time they came in. They are on the top of their game. I could never ask for more support than what I got.''

Photo: Brian P. Bilbray, a Republican who won election Tuesday to a vacant House seat in California, on his way to a radio interview yesterday. (Photo by Sandy Huffaker for The New York Times)(pg. A22)

Chart: ''Republican Seats in Play''
The special election in the 50th Congressional District of California was one of the tossup races considered most competitive by the independent Cook Political Report. Among the 12 races considered tossups, 11 are held by Republicans; the exception is Ohio's Sixth District, left vacant by Ted Strickland.