Legal advice from Geoffrey Cox, the attorney-general, is crucial to the navigation of Britain’s departure

Boris Johnson is legally entitled to take Britain out of the EU on October 31 without a deal even if he loses a vote of confidence and his government falls, the attorney-general has suggested.

Geoffrey Cox is understood to believe that there is no legal basis to prevent the prime minister from taking Britain out of the EU, even if October 31 arrives amid a general election campaign triggered by a no-confidence vote in the government over no-deal.

There is concern in government that Mr Johnson’s majority of two means he could be defeated in a vote of confidence and be forced to go to the polls.

Tory rebels have held talks with Labour and opposition parties about a possible vote of confidence