Hundreds of thousands of protesters march through central London yesterday, calling for a vote on whether to accept any Brexit deal

Civil servants have started secret contingency planning for a second referendum, it can be revealed.

Within the past fortnight they have responded to fears that Theresa May will struggle to get a Brexit deal through parliament and have been “war-gaming” a new vote.

Officials working for the Department for Exiting the European Union role-played the probable response to a fresh referendum by the prime minister and David Lidington, her de facto deputy. They also gamed the reactions of campaigners.

The Brexiteer MPs Boris Johnson and Jacob Rees-Mogg were among the roles played, along with James McGrory, director of the People’s Vote, the march through London yesterday. The organisers claimed it was attended by 670,000 people.

“Civil servants have to prepare for every eventuality and with