Republicans suffered another setback in California on Tuesday as Representative Jeff Denham was knocked out of office after four terms in a district representing a sweep of farmland in the Central Valley.

He was defeated by his Democratic challenger, Josh Harder, according to The Associated Press. Harder’s lead had grown over the past week, and the latest update Tuesday night showed him 4,919 votes ahead, a margin that Denham would not be able to make up.

Harder’s victory over an entrenched Republican is the latest sign of Democratic strength this year in California and the nation. The Democrats set out to unseat up to seven Republicans in California in districts that Hillary Clinton carried in 2016 but where registered Republicans outnumbered registered Democrats.

Denham’s loss to Harder, a venture capitalist, marked the fourth upset by a Democrat in California.

Two key congressional contests in the state remained too close to call. In the 45th District, Representative Mimi Walter, an Orange County Republican, is fending off a challenge by Katie Porter, a Democrat. And in the 39th District, one Republican, Young Kim, is seeking to fill the seat being vacated by another, Republican Ed Royce of Orange County. Ms Kim is opposed by the Democratic candidate Gil Cisneros.

With Harder’s victory, the Democrats have gained 33 seats in the House and appear on track to gain between 35 and 40 once all the nationwide counting is complete.