Mrs. May said she wanted the security pact signed fast, even before negotiators agreed on the Brexit deal. “We shouldn’t wait where we don’t need to,” she said.

The prime minister also offered one big concession that might prove controversial at home. When cooperating with European agencies, Britain would “respect” the jurisdiction of the European Court of Justice, she said. Hard-line advocates of Brexit have argued that Britain should take back control of its laws and judicial system and no longer be beholden to the rulings of the European court.

It is the latest self-imposed red line that Mrs. May has quietly crossed as Britain races against the clock to extricate itself from four decades of close cooperation with the 28-member bloc. She has conceded almost everything European negotiators have demanded in the first phase of talks, from a divorce settlement of 39 billion pounds (about $ 55 billion) to a transition period in which Britain will keep to European Union rules even after it legally quits the bloc.

“Another red line has gone pink,” said Mark Leonard of the European Council on Foreign Relations.

But for all of Britain’s tortured wobbles in the Brexit negotiations, it has leverage on defense, and many here paid close attention to Mrs. May’s speech.

Charles Grant, director of the Center for European Reform, a pro-European think tank based in London, called it “serious and detailed,” noting Mrs. May’s expertise on the subject as former home secretary.

Britain is the second-largest defense spender in NATO and one of the only members of the European Union to spend 2 percent of its gross domestic product on defense, as well as 0.7 percent of its G.D.P. on development aid, Mrs. May noted.

A member of the Five Eyes — an intelligence alliance among Australia, Canada, New Zealand, the United Kingdom and the United States — Britain also has very good intelligence to offer Europeans. If a security deal was not reached in a timely manner, Mrs. May said in what some perceived as a thinly veiled threat, citizens of both Europe and Britain would be less safe than they are today.

Florence Gaub, deputy director of the European Union Institute for Security Studies, or E.U.I.S.S., a research group, said that Mrs. May had a point.

“European fighters in ISIS don’t make any distinction between the U.K. and the Continent,” she said, referring to the Islamic State. “Brexit and the Channel don’t matter to them.”

Not everyone was convinced by Mrs. May’s pitch.

Jean-Claude Juncker, the president of the European Commission, said that it was wrong to try to mix security issues with the details of Britain’s exit from the European Union.

Once again, some said, Britain was asking for a special deal from the bloc, giving it more say in European affairs than any third country would normally have.

“They have not arrived in the 21st century,” said Helmut Anheier, president of the Hertie School of Governance in Berlin, after listening to Mrs. May’s speech. “This is late-stage empire grandstanding.”

Reinhard Bütikofer, a German member of the European Parliament for the Greens, dismissed Mrs. May’s speech as another attempt at “cherry-picking.”

“Who does she think she’s talking to?” Mr. Bütikofer tweeted after her speech.

Theresa May at #MSC2018. Her message: We will continue to be relevant and will continue to seek cooperation. Repeats arguments in favour of British cherry picking re EU relationship. Accuses EU of lack of will for pragmatic cooperation. Who does she think she’s talking to? pic.twitter.com/NbG6XBIOsK

— Reinhard Bütikofer (@bueti) Feb. 17, 2018

Britain has long been accused of wanting to enjoy all the privileges of the European Union without abiding by its rules. On defense, given the mutual dependence, London may just get somewhere.

Mr. Leonard said, “It’s the closest you can hope to get to having your cake and eating it, too” — once the stated aim of British foreign minister, Boris Johnson.

Mrs. May finished her speech to moderate applause. The chairman of the conference, Wolfgang Ischinger, said that given all the complications, Britain’s decision to leave the European Union was “extremely regrettable.”

“Everything would be so much easier if you stayed,” he said of Britain to the room. The applause that followed was longer and louder.