The talk radio station LBC has admitted a “regrettable and inexcusable error” after its presenter James O’Brien breached broadcasting rules in the runup to the Clacton byelection, which was won by Ukip.

Although O’Brien did not mention Nigel Farage’s party by name in the broadcast on the day of the election on 9 October, he did refer to “an anti-immigration party is poised to win a seat in a constituency where there aren’t any immigrants”.

Media regulator Ofcom said the reference would have been “clearly understood by listeners as a reference to Ukip” and amounted to “discussion and analysis” of the vote when the polls had opened, which is prohibited under UK broadcasting rules.

O’Brien, who memorably skewered Farage in an unrelated interview earlier this year, made the remarks in a discussion about Isis, or Islamic State.

“We, of course, are living in a country where an anti-immigration party is poised to win a seat in a constituency where there aren’t any immigrants,” said O’Brien.

“So we can’t really start sneering at other civilisations, and other cultures for being defined by division and enmity, when we appear to be rushing headlong into a similar environment ourselves.

“Just as a point of interest, I was looking at the census – yah, I am living the dream! – 2011 census with regard to Clacton, looking at how many immigrants are there. And do you know how many immigrants – there aren’t any in that constituency to speak of, 95.7%, I think, British-born and 95.7% white. It’s perfect, perfect territory in a sense.

“But the tiny number of immigrants who do live there, rather excitingly, the majority of them come from Germany. Who else comes from Germany, I wonder? We’ve just had a little bit of election analysis for you.”

Ofcom, in its ruling published on Monday, said the presenter’s references to “anti-immigration” policies, which he believed had the potential to lead to “division and enmity”, constituted a clear viewpoint on a policy issue that had featured prominently in the run-up to that byelection.

The station, which is owned by Ashley Tabor’s Global Radio, went nationwide earlier this year and has generated huge publicity with Nick Ferrari’s acclaimed weekly phone-in with the deputy prime minister, Nick Clegg.

Broadcasting regulations state: “Discussion and analysis of election and referendum issues must finish when the poll opens.”

LBC said it was an “incidental reference, made briefly and intended merely as an observation before James [O’Brien] returned to the main talking point … which concerned what to do about Isis”.

It said the comments did not amount to “a direct political message to his listeners, in that there was never an intention to try and sway a vote nor influence the outcome of the byelection”. It added that the presenter “did not dwell on his observation about Ukip, nor invite calls on it, and he quickly returned to his topic of Isis”.

Ofcom said it took into account the fact that the presenter had apologised and LBC’s acknowledgement that this had been “a regrettable and inexcusable error”.

An Ofcom spokesman said: ““After a detailed investigation, Ofcom found LBC broke broadcasting rules by airing a discussion which contained critical references to Ukip while the while polls were open for the Clacton byelection.”