Labour's Holly Lynch has held her Halifax seat, polling 25,507 votes to the Conservative Party's 20,131.
Halifax-born Ms Lynch, 30, who was first elected in 2015 with 40% of the vote, was defending a tiny minority of just 428 (1%).
Her majority is now more than 5,000.
She said: "I'm really delighted. It was quite a defensive campaign to start with and I was just really hoping to win.
"I'm delighted to win with an increased majority."
She hailed the success of fellow re-elected MPs Tracy Brabin and Paula Sherriff.
Her seat had been a key target for the Conservatives who had launched their election manifesto at Dean Clough Mill in the town last month.
The town's Conservative candidate, Chris Pearson, a local councillor, took 20,131 votes. Liberal Democrat candidate James Baker took 1070 votes. UKIP's Mark Weedon received 1,568 votes. The turnout was 67.9%
General elections in 2015, 2010, 2005, 2001 and 1997 had seen Halifax elect a Labour MP.