Image copyright Getty Images

It was hardly the best kept secret in British politics.

The European elections will, Cabinet Office Minister David Lidington has confirmed, take place on schedule, on 23 May.

The chances of the elections not being held in the UK were already vanishingly small.

It would have meant the UK Parliament agreeing a Brexit deal by 22 May - and there's no sign that is about to happen.

The prospects of a cross-party deal emerging between the Conservatives and Labour in the coming days look remote. It would take a dramatic turn of events to change that.

Even if an unexpected deal were to emerge, it would be only a very tentative first step towards Brexit, with no guarantee that it would enjoy a parliamentary majority.

And a first step isn't enough.

The conclusions of last month's EU summit, agreed by all EU leaders, including Theresa May, said that if the Brexit withdrawal agreement had not been ratified in Parliament by 22 May, the elections would have to take place in the UK.

The ratification process means Parliament would have to pass a meaningful vote on the withdrawal agreement (the deal negotiated between the government and the EU) and then turn it into UK law in the form of a withdrawal agreement bill.

And, as Mr Lidington has now conceded formally, time to do all of that has run out.

"Given how little time there is," he said, "it is regrettably not going to be possible to finish that process" before the elections take place.

That meant, he said, that the UK was legally obliged to hold the elections.

As a new report from the think tank The UK in a Changing Europe pointed out before Mr Lidington made his announcement, "a last minute cancellation could also leave some EU citizens (ie those resident in the UK) unable to cast a ballot and could leave the UK government subject to legal challenge".

If the government had decided to cancel the elections anyway, without a deal going through Parliament, a "no deal Brexit" would have happened on 1 June.

But we already know there is a clear majority in the House of Commons against leaving the EU with no deal.

So, the elections are happening, and most parties are already campaigning for them. Election leaflets have started to get posted through the nation's front doors.

The last time European elections were held, in 2014, the UK spent £109m on them. This year, according to a government source, a rough estimate for the cost is £150m - higher than last time because they're not being held on the same day as local elections (and sharing polling stations).

The Conservatives are unlikely to be campaigning this time with much enthusiasm, but reality has had to bite.

Image copyright Getty Images Image caption The UK spent £109m organising the 2014 European elections

So, if it is too late to stop the elections taking place, what is the next potential deadline?

A slightly more realistic date may be 2 July - when the new European Parliament meets for the first time and MEPs are sworn in.

The government would like to leave the EU before then, meaning the newly elected UK MEPs would never take their seats.

Mr Lidington said that would be in the national interest.

The problem? None of the challenges the government faces in finding a majority for Brexit in this Parliament are going to go away.

The EU has obviously worked that out. That's one of the reasons it approved a longer extension to the Brexit process, until 31 October.

Even now, though, thoughts are already turning in some quarters to what might happen after that - and whether an extension to the extension might be the only realistic way forward.

Read more from Reality Check

Send us your questions

Follow us on Twitter