The prime minister might have won a confidence vote but, asks political editor RICHARD PORRITT, what now for her leadership, Brexit and the country?

Theresa May's authority has been shot for some time.

Since she picked up the mess left behind by David Cameron amid the unprecedented fallout from the referendum to decide whether the UK should quit Europe she has faced disaster after disaster.

Some, but by no means all, of those problems have been of her own doing.

Cabinet ministers have walked. Deals have been written – and promptly rewritten. And for much of that time the threat of a leadership challenge has been thick in the air around Westminster.

In the tea room, corridors and bars where much of the political whispers, gossip and plots are formed the talk of those 48 letters going into the 1922 Committee has been rife for months.

When the magic number was finally reached on Tuesday evening it was hardly a surprise.

And now, with Mrs May able to fight another day, she will perhaps reflect it was the very best thing that could have happened. But she is weakened once again. By declaring she will not lead the party into the next election yet more power slips away.

Back in 1995 when the Tories were planning to topple Sir John Major he puffed his chest out and took them on. 'Put up or shut up,' he defiantly demanded. He won the intervening contest.

But Tory leadership rules have changed since then. Mrs May did not have the option of standing down and running again. She had to wait.

Not, at least, she has something of a new beginning. Even if it is the beginning of the end.

The threat of the hard Brexit faction has gone. They lost. The only weapon they had – giving the PM the heave ho – backfired.

The party is still divided, of course.

And what now for Brexit? Well, that is a different question altogether. Nothing has been solved by this piece of Tory navel gazing. It might only be a day but more time has been wasted.

Mrs May still has to get her deal through parliament. And that task remains seemingly insurmountable.

The prime minister still needs to eke out some give from the EU to get the deal sealed in the House of Commons.

How she does that remains difficult to fathom. Are the chances of a no-deal Brexit dead? Is a general election possible? A second referendum? It still feels like anything could happen.