LONDON — Despite mounting troubles over Britain’s withdrawal from the European Union and a recent cabinet resignation, Prime Minister Theresa May’s Conservative Party emerged relatively unscathed from local elections, according to results released on Friday that showed that its opponents had failed to make the breakthrough many expected.

Mrs. May has been struggling to deal with one crisis after another, many of them related to the negotiations over the withdrawal, but mixed results from across the country meant the opposition Labour Party failed to achieve the big, and symbolic, gains it was hoping for.

Labour was victorious in some key areas, but it fell short in its efforts to take control of two Conservative strongholds in London — Westminster and Wandsworth — that had been thought to be vulnerable, as well as the capital’s northern borough of Barnet, a much easier target.

On Friday, Mrs. May visited Wandsworth, where she exulted in the Conservatives’ victory there. “They threw everything at it, but they failed,” she said.