Rep. Dana Rohrabacher, a 15-term Southern California congressman known for supporting marijuana and Russian President Vladimir Putin, has lost his re-election bid to Democratic challenger Harley Rouda, according to The Associated Press.

Rouda declared victory himself some hours earlier on Saturday, four days after Election Day.

Determining the precise voting tally in the district could still drag on for weeks: In California, election officials have until Dec. 7 to report final results to the secretary of state, who has an additional week to announce official winners. As of Friday, however, Rouda led with 51.8 percent to 48.2 percent for the incumbent.

Rohrabacher, 71, had been accustomed to cruising to re-election in the affluent, conservative Orange County coastal sprawl south of Los Angeles. But Democrats made California’s 48th Congressional District a key target in this year’s midterm elections, focusing on Rohrabacher’s ties to the Kremlin, his conspiratorial statements, and his closeness with President Donald Trump, who lost the district by 2 percentage points in 2016.

Rouda, 56, a wealthy real estate executive, was a registered Republican for decades and contributed to Ohio Gov. John Kasich’s 2016 presidential campaign. He aggressively courted Republicans who may have stuck by Rohrabacher over the years for low taxes, but were turned off by the rhetoric of Trump and his allies.

Rouda pitched himself as a moderate, but also campaigned on progressive issues he described as common sense, including Medicare for all, tuition-free college, and a $15-an-hour federal minimum wage. He also called for more federal funding to provide housing for homeless residents — a risky move in the notoriously NIMBY district. He won support from the Indivisible progressive group and the establishment Democratic Congressional Campaign Committee.

Rohrabacher likes to describe himself as a maverick. But these days, he’s more of a reactionary than a libertarian. He has said that homeowners shouldn’t have to sell to gay people and that climate change could have been caused by dinosaurs farting. He called the death of a protester during last year’s white supremacist march in Charlottesville, Virginia, a “total hoax” manipulated by “left-wingers.” He speculated without evidence ― falsely, it turned out ― that a shooter at YouTube’s headquarters this year was an “illegal immigrant.”

Rohrabacher, a former speechwriter for Ronald Reagan, developed a bizarre fondness for Putin. After meeting with WikiLeaks founder Julian Assange last year, he suggested Russia was not involved in stealing emails from the Democratic National Committee during the 2016 presidential campaign.

He has defended Putin so frequently that Russian spies once tried to recruit him. House Majority Leader Kevin McCarthy (R-Calif.) joked in 2016 that both Rohrabacher and Trump were on Putin’s payroll.

The week before the election, the conservative-leaning Orange County Register editorial board reluctantly endorsed Rohrbacher, citing his support for marijuana legalization and his opposition to mass surveillance. But the paper acknowledged he was a less than ideal candidate: “Alas, Rohrabacher has a tendency to say wildly inappropriate things and support policies out of step with a limited government approach,” the editorial board wrote. “Rohrabacher’s off-the-cuff remarks often undermine confidence in him.”

Despite Rohrabacher’s vulnerability, Orange County has traditionally been a near-impossible place for a Democrat to win. But as of Saturday, with election results still coming in, Democrats appeared poised to control five of the seven congressional districts that include areas inside Orange County.