Once upon a time the Welsh didn’t much care for the Kippers. In successive European elections (1999, 2004 and 2009), Scotland always produced Ukip’s worst result and Wales was the second or third worst. It was a similar story in Welsh Assembly elections: in 2003, 2007 and 2011, Ukip talked up their chances of winning seats on the regional list, only to fall well short in the end. Wales seemed barren territory for what looked like a very English party.

Then things started to change. In the 2014 European election, Ukip came within a whisker of actually topping the poll in Wales. This was followed in the 2015 general election by the party securing 13.6 percent of the vote there, easily pushing Plaid Cymru into fourth place. The contrast with Scotland was by now stark: every single Ukip candidate in Scotland lost their deposit, whereas in Wales Ukip stood in all forty seats and every one of their candidates retained their deposit.

Ukip’s surge in Wales reflected substantial support for its policy agenda; support that was seen in June 2016 when Wales voted for Leave. But Ukip also took advantage of the failings of the other political parties – including a stagnant Labour government in Cardiff, and Plaid Cymru’s singular failure to come close to matching the drive and determination of the SNP. Their rising support was still insufficient for Ukip to come close to winning a parliamentary seat in Wales two years ago.

But come the 2016 Welsh Assembly election, the semi-proportional voting system allowed the party to make inroads. For the first time, Ukip achieved a substantial presence in a domestic legislature when they won seven seats in May 2016 – a greater number of Assembly Members than had ever been won by the Liberal Democrats. Ukip had not only arrived in Welsh politics; it seemed it was there to stay.

Yet now things have gone very wrong. Some of the problems were probably inevitable in a party as quarrelsome as Ukip. Soon after the Welsh Assembly election, an internal coup deposed Welsh party leader Nathan Gill from leadership of the Ukip Assembly group. Gill then chose to leave the Assembly group – while apparently remaining leader of the Welsh party. Other members of the Assembly group visibly struggled with their roles, and the most competent Ukip AM, Mark Reckless, has now left the party to resume his erstwhile status as a Conservative.

Leadership was once Ukip’s strength; its success in the good years was largely down to Nigel Farage. Now it has become a major weakness. The embarrassments and failures of Farage’s successor Paul Nuttall have received widespread attention. To these problems, Ukip in Wales have added the self-inflicted blow of their Assembly leader Neil Hamilton. For a minor party leader, Hamilton has maintained high public visibility. He has also demonstrated a malign genius at attracting headlines – perhaps most infamously when, in his early days in the chamber, he referred to Leanne Wood and Kirsty Williams as 'concubines' in Carwyn Jones’ 'harem'.

Farage understood how to pitch remarks so that, while outraging the liberal elites, he kept Ukip in the headlines and delighted many supporters. But Hamilton now seems to alienate almost everyone. In the latest Welsh Political Barometer poll, respondents were asked to rate all the UK and Welsh party leaders on a 0-10 scale. Hamilton hit a new low, averaging only 1.9 out of 10. I’m not aware of any party leader, anywhere, that has ever scored as badly on a similar question. Even among those who voted Ukip in 2015, Hamilton fails to average as high as 3 out of 10.

The result is that, in last week’s Welsh local elections, Ukip could not win a single one of the more than 1,200 Welsh local council seats. A big fat zero is also the number that the party’s opinion poll rating is rapidly approaching. Ukip’s greatest relevance to the 2017 election is now where its former voters go – with Theresa May and the Conservatives emphatically winning this contest at present. The Tories’ focus on Brexit is working very effectively with these voters: the latest Welsh poll has fully 67 percent of 2015 Ukip voters now intending to vote Conservative, with barely one-fifth remaining loyal to the Kippers. Many of these voters are in historic Welsh Labour heartland seats. In the south Wales valleys – all of which voted clearly for Brexit – the Tories probably start the general elections too far behind to oust Labour anywhere. But in places like Newport, Bridgend, and a clutch of seats in north-east Wales, the votes of 2015 Ukip supporters could easily power the Conservatives to an historic election breakthrough.

The future for Ukip looks grim. It now lacks popular and credible leadership. Meanwhile Theresa May is making the issue of Brexit her own, while also seeking to close down Ukip's advantage on immigration. There is now little that is unique to the party. The brief flowering of Ukip in Wales may already be over.

Roger Scully is Professor of Political Science at the Wales Governance Centre, Cardiff University. He is the principal investigator for the Welsh Election Study.