The choice of Hamilton as leader at Cardiff Bay will be seen as a blow for Nigel Farage, the Ukip leader, who is a fan of Gill, and could signal the start of a challenge both to Gill’s leadership in Wales and possibly even Farage in the UK.

Hamilton’s wife, Christine, said her husband would not speak to the Guardian, citing what she called a “vile” article by Michael White, who described him as a “shameless, self-promoting rascal”.

Following his win Hamilton told the BBC: “We’ve achieved an outcome by consensus. We decided to put all past differences behind us and forget the lead up to the election campaign, where there was a lot of personal animosity created.

“I’ve been chosen to do a specific job to be leader of the Ukip AMs within the assembly. I’ve got great deal of parliamentary experience. I’ve been a government minister. I’m going to make use of that experience within the group to give Ukip the maximum amount of impact during the course of the next five years.”

Gill told an election debate in April that he probably would not have chosen Hamilton as a Ukip candidate.

He was born near Blackwood in south Wales, but was MP for Tatton from 1983 to 1997 and his Welsh credentials have been questioned. In an impromptu quiz on the BBC he did not know that the famous Welsh band Manic Street Preachers come from Blackwood.