She received 15,529 votes with Labour’s Paul Williams second on 8,589 and independent challenger Samantha Lee coming third with 2,904.
The result means Mrs Mortimer will be the first Conservative MP to serve the town since naval hero Commander John Kerans stood down ahead of the 1964 General Election.
Health Secretary Matt Hancock was among those to congratulate her on the win, while Labour has been reminiscing on an “absolutely shattering result”.
The shadow secretary for communities and local government Steve Reed has described Labour’s defeat to the Conservatives in the Hartlepool by-election as “heart-breaking”.
Speaking on the BBC’s Today programme, he said: “There’s no hiding from the fact this is a shattering result for Labour, absolutely shattering, and for a town like Hartlepool that’s been Labour for half a century to now be in Conservative hands is heart-breaking for anybody who is Labour.
“It tells us that the pace of change in the Labour Party has not been fast enough… we have a breach of trust between too much of the British electorate and the Labour Party, and we haven’t done enough to repair it over the past year.”
On the Labour left, former shadow home secretary Diane Abbott – a close ally of former leader Jeremy Corbyn – said it had been a “crushing” defeat.
“Not possible to blame Jeremy Corbyn for this result. Labour won the seat twice under his leadership. Keir Starmer must think again about his strategy,” she tweeted.
Former shadow justice secretary Richard Burgon said the party needs to “urgently change direction”.
“We are going backwards in areas we need to be winning,” he tweeted.
“Labour’s leadership needs to urgently change direction. It should start by championing the popular policies in our recent manifestos.”
The left-wing, grassroots Momentum group which backed Mr Corbyn, said the result was a “disaster”.
Co-chairman Andrew Scattergood said: “Starmer’s strategy of isolating the left and replacing meaningful policy with empty buzzwords has comprehensively failed.
“If he doesn’t change direction, not only will he be out of a job – but the Labour Party may be out of government forever.”
But Steve Reed denied Sir Keir’s leadership had been a problem and said they would work “tirelessly” to rebuild trust in the party.
Speaking on BBC Breakfast, the shadow secretary for communities and local government said: “I’m very comfortable that we now have a leader that the country could see as an alternative prime minister – the problem is the Labour party itself.”
“We have not yet changed the Labour Party enough for people to feel able to go out and trust it with their and their children’s futures.”
The Conservatives, in contrast were jubilant, with co-chairman Amanda Milling saying they were “delighted” voters had put faith in the party.
“The work to repay that faith starts right now, as we continue with our agenda to level up and build back better from the pandemic,” she said.
Defence Secretary Ben Wallace tweeted congratulations to Jill Mortimer for her win in Hartlepool, adding: “I have represented a Lancashire seat for 16 years. Labour swapped the North and it’s voters for fashionable lefty elites long ago and are now paying the price.”
Health Secretary Matt Hancock tweeted: “This historic victory shows that the @Conservatives are delivering on the people’s priorities. A fantastic achievement & I look forward to working with you.”