Image copyright Getty Images

For hundreds of years, British prime ministers have weathered scandals, failure and resignations without needing to worry about Twitter.

The worst they could hope for was a scathing political cartoon in the newspapers.

But Theresa May's time in office came in very different days.

Although the phenomenon of the online meme is far from new, she may have been the first PM to truly - if unwillingly - embrace the medium.

So, as she dances out of Downing Street, here's a look back at her time in the often cruel spotlight of the online world.

March 2017: The laugh

The writing was on the wall early on.

Normally, an exchange at Prime Minister's Questions about Surrey County Council wouldn't unduly bother the Twittersphere.

But when the prime minister came over all Doctor Evil, throwing back her head and laughing at Jeremy Corbyn's questioning, well...

May 2017: The chips

Things really started to heat up - GIF-wise at least - after Theresa May called a general election in 2017.

She was hoping to win more support to give her a stronger hand in Brexit negotiations.

In the end it all backfired, rather like her attempt at eating chips.

As other politicians have discovered, food can be a minefield.

And when the PM tucked into a fried feast on the campaign trail, she was doused with the bitter vinegar of ridicule.

June 2017: Fields of wheat

Surely the safety of a TV studio would be a respite from meme-dom? Not so.

It was, in hindsight, a pretty loaded question; an open invitation to shoot yourself in the foot. But Theresa May embraced it wholeheartedly.

"What's the naughtiest thing you ever did?" asked ITV's Julie Etchingham. And the prime minister revealed that she and her childhood friends "used to run through fields of wheat".

Twitter had, if you'll forgive us, something of a field day.

August 2018: Dancing

As 2018 rolled around, Brexit began to loom on the horizon like a herd of wildebeest on the veld, and even a long-haul flight to Cape Town brought no respite.

When the PM gamely joined in with some dancing at a high school during a visit to South Africa, Twitter was ready.

October 2018: Dancing queen

Surely the best defence against mockery is to laugh at yourself the loudest?

Mmm.

Mrs May certainly had a go at the Conservative Party conference, coming on stage to Abba's Dancing Queen with what was perhaps a spirited attempt at '80s dance craze the Robot.

Image copyright Getty Images

It was a laudable effort.

But - to some at least - it came across as more SOS than Thank You For the Music.

May 2019: The end

In the end, perhaps it was fitting that even Theresa May's emotional resignation speech was greeted this way.

When, after ceaseless months of pressure and backstabbing, she finally broke and cried in Downing Street, there was sympathy from some...

But by no means from all.

Whoever the next occupant of Downing Street is, he should know: while he's trying to deal with Brexit and Iran, Twitter will be watching, ready.

Follow Newsbeat on Instagram, Facebook, Twitter and YouTube.

Listen to Newsbeat live at 12:45 and 17:45 weekdays - or listen back here.