The former group leader of UKIP, Neil Hamilton, has been blocked from taking a top job in the administration of the assembly.
In an unprecedented move AMs voted by a majority to stop the former Tatton Tory MP from becoming a commissioner.
Labour AMs and others believed that Mr Hamilton was unsuitable after he had failed to support a policy aimed at tackling harassment in the legislature.
A total of 31 AMs voted against the appointment, versus 17 for.
Commissioners oversee different aspects of the operation of the assembly – and earn more money than ordinary backbench AMs.
There are four commissioners, and each party group gets to nominate one.
Normally, the selection is a matter for the parties concerned and does not get to a vote.
If Mr Hamilton had been successful in his bid, he would have gained an extra £13,578 on top of his £66,847 basic backbench AMs’ salary, bringing his total pay to £80,425.
He had earned £85,000 a year as group leader until he was deposed in May.
Before he lost his job as leader Mr Hamilton abstained on an interim assembly policy aimed at tackling inappropriate behaviour. Most assembly members had supported it.
Prior to the vote Cynon Valley Labour AM Vikki Howells said: “The dignity and respect policy is fundamental to how the assembly must operate and I cannot countenance supporting someone who has failed to endorse that policy.”
Mandy Jones, a UKIP member who sits as an independent AM, told the Senedd on Wednesday that she was also objected to Mr Hamilton’s nomination because of his abstention.
She said becoming an AM was “not a part time job” and the code of conduct does “not get shrugged off like a wet coat when they become too uncomfortable”.
“I do not see how his position is compatible with the role of an assembly commissioner,” she said.
Mr Hamilton had promised AMs that he would have served as a commissioner “with the kind of professionalism and honesty and integrity I think I have displayed in the two years I have been here”.
The Tories had been expected to back the nominations. One source in the party said thought it was “irregular to try and tell a group who they can and can’t put forward”.