The upstate Democrat declared victory shortly after 9:30 p.m. — about a half-hour after polls closed in the Empire State.

“Tonight is an important night for the direction of our country,” Gillibrand said. “I can’t thank you enough for the honor and privilege of continuing to fight for New York families in the United States Senate.”

The prospects for her fellow Democrats to hold on to Senate control looked bright last night as two Republican candidates fell victim to their own controversial comments on rape.

Meanwhile, House Republicans last night were on their way to holding their majority with projections that they would come away with more than the 218 seats needed to control the chamber.

Senate Dems began the night with a six-seat majority in the upper chamber of Congress — 51 party members and two independents who caucus with them. They were on track to possibly add to those net numbers.

A major pickup came in Massachusetts, where Harvard law professor Elizabeth Warren dethroned incumbent Republican Sen. Scott Brown in Massachusetts.

Brown had sought his first full term after winning a 2010 special election to replace the late Sen. Ted Kennedy.

Another net gain for the Democrats came in Indiana, where state Treasurer Richard Mourdock lost to US Rep. Joe Donnelly in their campaigns to replace longtime Republican Sen. Richard Lugar.

Mourdock — who had ousted Lugar with a Tea Party-infused primary challenge — saw his poll numbers plummet after he said in a debate that he opposed abortion even in cases of rape because “I think that even when life begins in that horrible situation of rape, that it is something that God intended to happen.”

Likewise in Missouri, freshman incumbent Democratic Sen. Claire McCaskill beat back her Republican challenger, US Rep. Todd Akin, in a race that hinged on the issue of rape.

The pro-life Akin ignited a firestorm by bizarrely saying that cases of pregnancies from rape were “really rare” because “if it’s a legitimate rape, the female body has ways to try to shut that whole thing down.”

Angus King, an independent who is expected to caucus with Democrats, became Maine’s next US senator — replacing retiring Republican, Olympia Snowe.

In Connecticut, the Democratic US Rep. Chris Murphy beat Republican and ex-pro-wrestling company exec Linda McMahon — who has dropped nearly $80 million in two consecutive senate races — to replace outgoing Sen. Joe Lieberman, an independent who caucused with Democrats.

In Wisconsin, Democratic Rep. Tammy Baldwin bested former Republican Gov. Tommy Thompson in the race to replace the incumbent Democrat, Herb Kohl, who is retiring from the Senate.

The GOP took at least one seat from the Democrats as of last night — in Nebraska. Republican contender Deb Fischer beat former Sen. Bob Kerrey in the race to replace retiring Democratic Sen. Ben Nelson.

House Republicans staved off an aggressive drive by Democrats to retake the majority they lost in 2010.

“Our House majority has been the primary line of defense for the American people,” House Speaker John Boehner said. “Americans want solutions and they responded by renewing our Republican House majority.”

In other races around the nation, a Kennedy returned to Congress with the House victory of Democrat Joe Kennedy III in central Massachusetts.

In Kentucky, Democratic incumbent Ben Chandler lost, while in North Carolina, incumbent Democrat Rep. Larry Kissell also fell. In Illinois, at least three incumbents faltered including Republican Rep. Joe Walsh, who lost to Democrat Tammy Duckworth.