Smoke rebel Hamish Howitt has won his fight to keep his Blackpool pub open.
Howitt won his appeal against Blackpool Council's decision to revoke the premises licence of Delboy's Sports Bar in November.
However, the council said it would appeal the decision.
The original review was sought on the grounds of prevention of crime and disorder, protection of public safety and protection of children from harm.
The council claimed that trading standards and health and safety officers had uncovered problems including insecure carbon dioxide cylinders, unmaintained electrical installations, a basement staircase in a state of disrepair and damaged toilets.
This is a smokescreen - the council can't stand the fact that they can't shut me down for allowing smokingHamish Howitt
Howitt was also accused of failing two underage test purchases.
None of the charges related to flouting the smoking ban.
Howitt had claimed that the wrong premises licence had been revoked.
He has a separate premises licence for his karaoke bar, Happy Scots, which is downstairs from Delboys.
He allows smoking in Delboys but not in Happy Scots bar.
Deputy district judge Jane Goodwin, who at one stage visited the pub for an inspection, said there was not sufficient evidence to revoke the licence.
Howitt, who represented himself against the council's barrister, told the MA: "I am absolutely over the moon.
"You don't often beat the establishment. I studied hard to represent myself and it was real David v Goliath stuff.
"My pub is safe. I would never put anyone in danger.
"I am proud of the way I run my pub. This is a smokescreen - the council can't stand the fact that they can't shut me down for allowing smoking.
Howitt will now also be able to claim his costs from the council.
Cllr Peter Callow, leader of Blackpool Council, said: "We are disappointed that Mr Howitt's appeal has been upheld.
"We believe the District Judge has made the wrong decision and we intend to appeal to the High Court.
"The Council has a duty to enforce licensing legislation and will continue to rigorously carry out its duty to ensure public safety.
"We are not seeking to be heavy handed but to emphasise that we expect the resort to be welcoming and law abiding.
"This is part of the Council's commitment to continue to clean up the town."