LONDON — The European Parliament election in the U.K. last month showed the country has changed its mind on Brexit.

Nigel Farage’s upstart Brexit Party stole the headlines by coming first in the polls and gaining 29 seats in the new Parliament. But his apparent victory obscures a deeper truth about what voters want.

In reality, more people signed a petition earlier this year to revoke Article 50 than voted for the Brexit Party in the May election. The Liberal Democrats were hugely successful in the election — where we came second with 20 percent of the vote — because of our clear message to stop Brexit.

British voters are clearly fed up with the government’s inability to find a viable solution when it comes to Brexit. And a majority now understand that only a new Brexit referendum can solve the parliamentary deadlock.

We are closer than ever to securing such a second referendum. Indeed, it’s the option that makes sense.

The Conservatives and the Labour Party are facing discouraging polling figures, so calls on their part for a general election are unlikely.

Granting us another extension would also have the added benefit of letting the U.K. have a say in the process of selecting the next European Commission president.

Nor can Theresa May’s Brexit deal be renegotiated, despite what a number of Tory leadership candidates claim in their misleading appeals to Brexit voters. The conditions of previous Brexit extensions granted to us by the European Union clearly state that the agreement can’t be reopened.

Regardless of what hard-line Brexiteers like Farage may claim, our parliament clearly does not want a no-deal Brexit either. The outgoing prime minister tried to blackmail parliament into voting for her Brexit deal three times, saying it was a choice between her Brexit deal and no deal. British MPs rejected that threat and we will do so again if it comes to it.

So where does this leave us? The government’s infighting and inability to compromise has left us at the mercy of our European partners.

Being granted the time to hold a second referendum also means we may be able to maintain our place in the EU for good and remain close partners.

French President Emmanuel Macron was reluctant to grant the U.K. an extension to the process the last time we faced crashing out without a deal in March. He could well decide to refuse a further extension when time runs out again on October 31.

I know European leaders are exasperated. I share that sentiment. But there are good reasons to give Britain a little more leeway if we ask for it.

Eventually the next Conservative prime minister — who will be elected in July — will realize that the promise of a second referendum must be attached to the existing Brexit deal to get it through parliament. The U.K. would then need extra time to legislate for it and to hold the vote.

Granting us another extension would also have the added benefit of letting the U.K. have a say in the process of selecting the next European Commission president.

As leader of the Lib Dems, which has partnered with Macron’s En Marche party as part of the Alliance of Liberals and Democrats for Europe (ALDE) in the European Parliament, I share the French president’s belief that the best way to restore credibility in European institutions is for our group to insist on selecting the best people for the top EU jobs.

Our MEPs have boosted the group’s ranks and would allow it to have more sway in these important discussions and in key votes.

But without an extension to the Brexit process in October — or a revocation of Article 50 before then — we will not have the chance to stand alongside our fellow MEPs.

Being granted the time to hold a second referendum also means we may be able to maintain our place in the EU for good and remain close partners.

It’s been a frustrating process — for all involved. But I’d urge Europe to keep in mind that the next time the U.K. requests an extension, it may be the one that gives us the time we need to finally end this Brexit nightmare once and for all.

Vince Cable is the leader of the U.K.’s Liberal Democrats.