Rep. Jim Costa was declared the winner Tuesday in an unexpectedly tight race against Republican challenger Andy Vidak. 

The AP called the race for Costa, who lead by more than 3,000 votes with just a small number of ballots left to be counted. The district is heavily Democratic, and the three-term lawmaker cruised to reelection just two years ago.     

The call did not generate an immediate concession from Vidak, but Costa has already declared victory.  

Earlier Tuesday, upstate Rep. Dan Maffei (D-N.Y.) conceded defeat to Republican Ann Marie Buerkle, officially handing the GOP a 63rd seat.  

Just two House races remain outstanding. Rep. Tim Bishop (D-N.Y.) leads his GOP challenger by more than 200 votes, and Rep. Jerry McNerney (D-Calif.) appears to have an insurmountable lead over Republican David Harmer.