Representative Dana Rohrabacher, a Republican fixture in California who represented Orange County for 15 terms, has lost his bid for re-election. His defeat underlines the party’s setbacks in a part of the state that was long a symbol of its political dominance.

The Associated Press called the race on Saturday, with Harley Rouda receiving 52 percent of the vote to Mr. Rohrabacher’s 48 percent.

Mr. Rouda, 56, is a former Republican turned Democrat who became a symbol of the Democratic efforts to win back Congress this year. Mr. Rohrabacher, 71, was viewed as particularly vulnerable because he defended Russia in the midst of allegations about its efforts to intervene in elections in the United States.

In July, Mr. Rohrabacher admitted to meeting with Maria Butina, who was charged by federal prosecutors this summer with conspiracy and acting as a foreign agent, during his trip to Russia in 2015. Mr. Rohrabacher was considered so valuable to the Kremlin that the F.B.I. warned him in 2012 that Russia regarded him as an intelligence source worthy of a code name. His support for President Vladimir Putin of Russia raised questions even among fellow Republicans.