Kennedy defeated Republican Gary Dickson, a town supervisor, in the Upstate New York district that includes the cities of Buffalo and Niagara Falls and will serve out former Democratic congressman Brian Higgins’s term, which ends in January. Higgins, who was first elected to the House in 2004, resigned his seat in February to take a job leading a performing arts center in the Democratic-leaning district.

When Kennedy is sworn in as a member of the House Democratic conference, it will temporarily shave the chamber’s Republican majority to one seat, leaving a small margin for error for party-line agenda items. House Republicans hold 217 seats and Democrats, with Kennedy, will have 213 seats, leaving vacant five seats.