A Tory MP who cheated on his wife while she fought breast cancer has been reselected by his local party as their prospective parliamentary candidate.

The decision in a postal ballot to readopt James Gray, 52, a Glaswegian, came as a surprise as North Wiltshire Conservative Association executive voted in November to deselect him following revelations that he had an affair while his wife, Sarah, was undergoing treatment.

It was widely thought that a wider postal ballot of the 350 party members in his constituency would rubber-stamp the executive's decision to deselect him.

However, the results, which were announced yesterday, revealed that Mr Gray had won a reprieve and would be put forward as the Conservative candidate for the North Wiltshire constituency in the next General Election. A spokesman for the Conservative Party said they never made public the amount of votes cast in postal ballots and would not say by how wide a margin Mr Gray won.

Mr Gray, who was educated at Hillhead Primary, the High School of Glasgow, Glasgow University and Christ Church College Oxford, has been the MP for North Wiltshire since 1997. He is the son of the late Dr John Gray, the former Moderator of the General Assembly of the Church of Scotland.

Mr Gray was made Shadow Scottish Secretary last year but resigned two weeks later after suggesting MSPs should be abolished.

He said yesterday he was delighted to have been reselected and would now go out of his way to heal rifts within his local party.

"I quite respect the views of those who have voted against me on the executive council, who believe that an MP's divorce makes it hard to offer him an automatic readoption.

"I am delighted and humbled that overall the membership of the association voting in the secret ballot has concluded that my record as their MP, in the constituency and in Parliament, outweighs any disapproval they may feel with regard to my private life. I'm mending as many bridges as I can. It's my job to do that."

His estranged wife, Sarah, who married Mr Gray 29 years ago, said she did not want to comment.

She said that her cancer treatment was continuing and at the moment the illness was being kept at bay.

It emerged last year that Mr Gray had been having an affair with mother-of-three Philippa Mayo, 44, a Countryside Alliance campaigner, whose husband, a judge, criticised the MP for his behaviour.