A Conservative Senedd member who took his local party to court over an attempt to deselect him has withdrawn his legal challenge.
Nick Ramsay wanted to stop a meeting of the Monmouth Conservative Association (MCA) from going ahead next week.
But his application for an injunction has been withdrawn and a judge ordered Mr Ramsay to pay £25,000 in costs.
Mr Ramsay said he had wanted clarification from MCA to "ensure no further damage was caused."
At the virtual hearing at Bristol Civil Justice Centre, Mr Ramsay's injunction application was withdrawn, and a judge said if the application to injuct had been made it would have failed.
Judge Paul Matthews said Mr Ramsay has 28 days to make the costs payment to the successful party - MCA chair Nick Hackett-Pain, on behalf of its members - and no permission was granted for appeal.
Mr Ramsay said he withdrew the application after the MCA "changed their position at the eleventh hour" and claimed he was the victim of a "witch hunt".
He added: "I still do not know what I have done and that has still not been disclosed. There are a few bad apples who I believe have poisoned the barrel."
The MCA spokesman said it was "absolutely delighted" with the ruling.
"We hope that Mr Ramsay recognises the right of this association to conduct itself in a democratic fashion," he added.
Mr Ramsay's future in the Senedd will be considered on Monday, where members will discuss a petition to deselect him.
If the petition is approved, another meeting would be required to formally deselect him and he would then be allowed to take part in the final reselection process.
But Mr Hackett-Pain said he believed "very few" members would be willing to campaign for Mr Ramsay after he had attempted and failed to injunct the association.
He told BBC Wales that "members of the association are not going to be impressed when their own candidate sues their own association".
Fellow Tory David Davies, MP for Monmouth, welcomed the decision to "defend the right of the association".
Mr Davies wouldn't make comment on Mr Ramsay directly but said: "All elected members owe their positions to voluntary associations and therefore I cannot personally conceive of a situation ever in which if the association wanted a meeting with me I would rush to lawyers and threaten them with my costs. I would never ever behave in that fashion."
One source told BBC Wales more than 50 members had signed a petition against Mr Ramsay, which amounts to more than a tenth of the association's 500 members.
It is the second legal action Mr Ramsay has staged this year, after the politician took the Welsh Parliament's Conservative leader Paul Davies to court over his suspension from the Senedd Tory group.
It is understood that central Conservative Party officials will be involved in running the meeting on Monday and taking votes.
However, it would not trigger deselection alone, and if members agree with the petition's premise further discussions would be needed for deselection to happen.