Conservative David Morris has been re-elected as MP for Morecambe and Lunesdale with a majority of 1,399, down from 4,590 in 2015.
Mr Morris said afterwards he would carry on “bringing sunshine” to the people of Morecambe and being “the best MP Morecambe has ever seen”.
The Tory, who has been MP since 2010, retained his seat in a close battle with Labour’s Vikki Singleton.
Mr Morris gained 21,773 votes compared with Mrs Singleton’s 20,374.
Lib Dem Matt Severn got 1,669 votes, UKIP candidate Robert Gillespie got 1,333 votes and Green candidate Cait Sinclair got 478.
Meanwhile Labour’s Cat Smith retained her Lancaster & Fleetwood seat with an increased majority of 6,661.
Ms Smith defeated Conservative Eric Ollerenshaw, in a repeat of the 2015 result, by 25,342 votes to 18,681.
Liberal Democrat candidate Robin Long got 1,170 votes and Rebecca Novell of the Green Party got 796 votes.
Mr Morris pointed out after the declaration that he had polled more votes this time than in 2015, when he defeated Labour’s Amina Lone.
But Mrs Singleton accused him of “arrogance” in saying he was the best ever Morecambe MP, and “disrespect” to his predecessor Geraldine Smith, Labour MP from 1997 to 2010.
“This result is a clear message from the electorate that they are not happy, they want change, they want an MP who wants to represent them,” she said afterwards.
“The arrogance of him to say that he is the best MP Morecambe and Lunesdale has ever had when he had lost a huge chunk of his majority.
“I’m not going anywhere. I’m going to scrutinise David Morris.”
Mr Morris, when asked if he felt his remarks were arrogant, said: “I hope Vikki Singleton can find her way home.”
This was a dig at Mrs Singleton who had put a Lancaster address on her official ballot paper when she also has an address in Blackpool.
Matt Severn said after coming third: “We have leapfrogged UKIP into third and our core voters turned out.”
After the declaration, Ms Smith said: “I am absolutely delighted to be re-elected. I am looking forward to continuing the work that I have been doing.
“I think it’s fair to say that I wasn’t planning on delivering a victory speech. It was a lot clearer in the end than I expected.”
Mr Ollerenshaw thanked his team and everyone involved in his campaign.
He said: “We couldn’t have fought better or made it any better.
“We were overwhelmed by a Labour machine.”
Earlier in the evening, Mr Long said he felt Labour had successfully squeezed the vote and would retain the Lancaster seat, while Rebecca Novell said she believed Labour had “borrowed” a few Green votes as expected and she was hopeful of a strong swing towards Labour nationally.
Polls closed across Lancaster and Morecambe district at 10pm on Thursday.
The count began in the early hours of Friday after ballot papers were verified, amid tight security at Lancaster Town Hall.
There was initial excitement as the Morecambe and Lunesdale turnout figure was originally given as 82.5%, which would have been the highest in the history of the seat since it was renamed from Morecambe and Lonsdale.
But the figure was corrected a few minutes later to 68.4%, up from 65% in 2015. Lancaster and Fleetwood turnout was 68.6%, the same as 2015.
LANCASTER AND FLEETWOOD RESULTS
Catherine Jane Smith (Labour) 25,342
Eric Ollerenshaw (Conservative) 18,681
Robin Eamonn Long (Lib Dem) 1,170
Rebecca Joy Novell (Green) 796
MORECAMBE AND LUNESDALE RESULTS
David Thomas Morris (Conservative) 21,773
Vikki Irene Singleton (Labour) 20,374
Matthew James Severn (Lib Dem) 1,699
Robert Wilson Gillespie (UKIP) 1,333
Cait Sinclair (Green) 476