David Cameron has distanced himself from remarks made by an MP facing deselection after cheating on his wife while she was being treated for cancer.
Mr Gray has been North Wilts MP since 1997
North Wiltshire MP James Gray told the BBC he had the Tory leader's "very strong support", after his local party executive voted to drop him.
But Mr Cameron's spokesman said on Friday it would not be right for him to get involved in local party matters.
Father-of-three Mr Gray, 52, now faces a postal ballot of local Tories.
He was criticised by the North Wiltshire Conservative Association for being unfaithful while his wife, Sarah, 51, was treated for breast cancer. They are getting divorced.
The local party executive met in Chippenham on Thursday night, and voted against Mr Gray continuing to represent them at the next election. He has been the local MP since 1997.
Afterwards Mr Gray told BBC South West, "I have the very strong support of David Cameron. I was his campaign leader here in the west country during his leadership battle.
"He's a close friend of mine. I was a special adviser with him many years ago.
"He, the chief whip, and the chairman of the party have all said they strongly support my position as member of parliament and I hope the members here locally accept that." But asked about the comments later, Mr Cameron's spokesman would not give his support, saying it would not be right for the party leader to get involved in what was a matter for the local party.
There will now be a postal ballot on Mr Gray's future of the whole North Wiltshire Conservative Association, which he says he is "hopeful" of winning.
"I quite understand North Wiltshire Conservative Association Executive's sadness at the ending of my marriage.
"I believe that my record as a constituency MP over nearly 10 years is acknowledged by the membership of the party at large and I hope they will take the view that my local record outweighs any disappointment they may feel at my personal life."