SAN FRANCISCO (Diya TV) — Rep. Ami Bera will keep his seat in the U.S. House of Representatives after a narrow victory over Republican challenger and Sacramento County Sheriff Scott Jones in California’s 7th District.

When the Associated Press called the race Friday afternoon, more than a full week after Election Day, Bera held a lead over Jones of just 6,000 votes, or less than three percentage points.

The win for Bera ends a contentious campaign for both candidates, both of whom were plagued by scandal in the days leading up to the election.

Bera faced intense scrutiny after his father pleaded guilty in federal court to illegally funneling money into his 2010 and 2012 congressional campaigns. In August, a federal judge sentenced the elder Bera to one year and one day in prison for his crimes. The congressman has said he didn’t know about his father’s illegal behavior and in May the U.S. attorney’s office said it found no evidence he was involved.

Over the summer, allegations arose that Jones had sexually harassed a subordinate at the Sheriff’s Department. In a court deposition, a female deputy working for Jones said he made multiple unwanted sexual advances to her more than a decade ago, the Sacramento Bee reported in July. Jones has denied the allegations.

During his campaign, Bera used the allegations and Jones’ tough stance on illegal immigration to compare his opponent to Donald Trump, who has faced claims of sexual harassment from multiple women.