“When we negotiated the outcome of the justice and home affairs… brief in Europe, [Theresa May] negotiated us out of 100 out of 135 aspects of the treaty.”
David Davis, 1 June 2017
The Coalition government did opt out of around 130 previously enacted EU security and criminal justice laws, 35 of which it subsequently opted back into. Theresa May was Home Secretary at the time, but the right to opt out of the measures was negotiated under a previous government.
The Treaty of Lisbon came into force in 2009 and intended to reform the European Union following its enlargement from 15 to 27 member countries. One element of the Treaty was that security and justice measures would no longer require the unanimous agreement of member countries.
But at the time the UK Labour government, along with Ireland, negotiated the ability to opt out of future security and justice laws on a case-by-case basis. In addition, they also negotiated the ability to opt out of all 130 pre-Lisbon security and justice laws, with the provision that they could opt back into some of them.
In July 2013 the Coalition government notified the EU that it would make use of the block opt-out option. It also decided to opt back into 35 measures that it felt remained in the national interest including, for example, the European Arrest Warrant.
EU members had to agree unanimously on the UK’s opting back into the 35 measures. So there were negotiations required, and they were successful from the UK’s point of view.
Theresa May was Home Secretary at the time, but it’s difficult to say what her exact involvement in negotiations was.