Attorney Ro Khanna defeated Rep. Mike Honda (D-Calif.) in the race to represent California’s 17th District, ousting the progressive congressman from the seat he’s held for more than 15 years.

Honda, first elected to Congress in 2000, ran on his legislative record, touting his work on issues such as education, income inequality and civil rights. But Khanna, a lawyer who served under President Barack Obama in the Department of Commerce, painted himself as an energetic replacement for Honda and made the congressman’s ethics probe a key issue in the campaign.

Khanna and Honda are both Democrats. Under California’s “jungle” primary system, the top two finishers in a primary advance to the general election, regardless of party affiliation. While there was little daylight between the two candidates on most issues, Honda and Khanna represented battling factions of the Democratic Party. Honda, a progressive stalwart allied with labor unions, appealed to voters as a champion of working families, while Khanna billed himself as a tech-savvy upstart focused on job creation and business-friendly policies.

Each candidate’s endorsements reflected this split. Honda received endorsements from many labor groups and most of California’s Democratic establishment, including Sens. Barbara Boxer and Dianne Feinstein, House Minority Leader Nancy Pelosi and Attorney General Kamala Harris. Notably absent from Honda’s endorsement roster was President Barack Obama, who declined to take a side after backing Honda in 2014.

Khanna, meanwhile, garnered support from tech heavyweights such as venture capitalist Marc Andreessen, Facebook executive Sheryl Sandberg, Salesforce chief Marc Benioff and Yahoo CEO Marissa Mayer. But after narrowly losing to Honda in 2014, Khanna sought to broaden his appeal beyond Silicon Valley bigwigs. He touted an early endorsement from state Senate President Pro Tem Kevin de León, who is widely regarded as a promising up-and-comer in California politics. He also notched endorsements from former President Jimmy Carter, California Secretary of State Alex Padilla and many local politicians.

Honda narrowly survived a challenge from Khanna in 2014, one of that cycle’s most bitter and most expensive contests. This year’s rematch was similarly contentious.

Honda’s ethics case took center stage throughout the campaign. A report released last fall found that Honda and his staff may have violated federal law by using government resources to benefit his re-election campaign. Honda has denied the charges, which are still under deliberation in the House Ethics Committee.

But in September, Khanna’s campaign found itself in a potential ethical mess of its own when Honda accused the attorney’s campaign manager of illegally accessing information on Honda’s fundraising efforts and using it to benefit his candidate. Honda filed a civil suit against Khanna, a move Khanna called “political gamesmanship.”