Tama Potaka won by a 2285 vote majority over Labour’s Georgie Dansey.
With 100 percent of the vote counted, Potaka led the way with 6629, well ahead of Dansey’s 4344.
Act’s James McDowall came in third with 1462, while former Hamilton West MP Gaurav Sharma, whose resignation triggered the byelection, finished fourth with 1156 votes.
Potaka said: “I am pretty happy. I am pretty happy to be given the opportunity by the hardworking people of Hamilton West.
“I will be a strong voice for them in Parliament.”
National leader Christopher Luxon arrived shortly after and told reporters it was a “fantastic result”.
“I am really excited for Tama and the National Party. It’s a fantastic time.”
Senior National MP Chris Bishop said: “The people of Hamilton West have sent a message to this Government - change is coming.”
Talking to party supporters later, Luxon said to Potaka: “I know this is the beginning of a fantastic political career”.
One of the visitors to the National Party function was Gaurav Sharma, whose split from Labour led to the by-election.
He said he wanted to visit Potaka to congratulate him.
Sharma said he would now have a debrief with his team and volunteers and would then “review what the next stop is”. He believed he did have a chance to winning back the seat, but polled just 1136 votes in the by-election.
Over at Labour’s byelection night party, Local Government Minister Nanaia Mahuta said it had been "a difficult time".
“I think the media narrative of calling this a bellwether seat is not the correct narrative for what we were going into. Nobody wanted to have a byelection and in many ways that created challenges in itself we all know.
“And also as we head into Christmas it’s been really hard this year. People are feeling the weight of a really difficult period of time and through all of that Georgie has presented a positive campaign, that’s why we’re so proud of her.”