LONDON (Reuters) - Britain’s AA credit rating may not be affected by any change of prime minister, S&P Global said on Wednesday, but it would be unlikely to survive an economically painful hard Brexit from the European Union.

An anti-Brexit demonstrator wears a Union flag decorated with the stars of the EU flag opposite the Houses of Parliament in London, Britain, December 12, 2018. REUTERS/Eddie Keogh

With less than four months to go until the UK is due to leave the EU, events have been plunged into chaos as members of Theresa May’s ruling Conservative party, unhappy at her Brexit plans, have moved to oust her.

Britain became the first triple-A country to suffer a two-notch downgrade following the 2016 Brexit vote, and S&P has kept a ‘negative’ outlook -- effectively a downgrade warning -- on its rating ever since.

“A change of leadership would be an important development for us to take into account but I wouldn’t necessarily characterize it as an automatic rating action,” S&P’s lead global sovereign analyst Roberto Sifon-Arevalo told Reuters.

“We would need to analyze what it actually means for future policymaking: who is coming after and what are the policies.”

That wouldn’t take long to figure out, he added, but it is also feasible that May could survive, which would prevent another leadership challenge being mounted for a year.

S&P’s big worry for the UK rating remains a drastic move away from the EU with a so-called ‘hard Brexit’. Its economists have done a set of economic forecasts on that scenario.

“That showed an important hit to the economy that is likely to have an impact on the rating,” Sifon-Arevalo said, although even then it might want to see how bad the hit is.

The other alternative that has been touted amid all the turmoil is a second Brexit vote to check the UK public still supports the idea. If it no longer does, London could make a U-turn and stay in the EU.

“Taking away the uncertainty of Brexit from the equation has to be positive (for the rating)”.

“But given the degree of support that Brexit had, it would be important to see what the social reaction is to it.”

“Like in France, you do have a super-charged environment where people are willing to go and protest on the streets which puts a lot of restrictions on policymakers.”