British Prime Minister David Cameron on late Friday night made it official: after marathon negotiation sessions, he’d finally brokered a compromise with fellow European Union leaders to meet his demands ahead of a referendum that will determine Britain’s future membership in the political bloc.

On Twitter Friday night, Cameron said, “I have negotiated a deal to give the U.K. special status in the E.U. I will be recommending it to Cabinet tomorrow.” At a press conference later on Friday, Cameron said the deal did not solve “all of Europe’s problems,” nor did it solve “all of Britain’s problems with Europe,” but he repeatedly characterized it as a “good agreement.”

 

E.U. leaders met in Brussels on Thursday for a two-day summit with Cameron’s demands top on the agenda. The prime minister presented his counterparts with a series of requests that he said he needed met in order to better sell the British people on staying in the political group.

The final deal gives the U.K. a so-called emergency brake that will allow it to curb the welfare benefits for E.U. migrants for up to four years. The U.K. will be able to trigger that mechanism for as long as seven years. Cameron said that the deal will change the E.U. treaty so that Britain is free from abiding by the “ever-closer union” principle, and so that the country’s national security is solely the U.K.’s responsibility. The deal also permanently protects the British pound and the right for nations in the E.U. to have currencies other than the euro.

Friday’s deal, while largely anticipated, is just a warm-up for what will be the truly historic event: Britain’s referendum on whether it will remain part of the E.U., which Cameron wants to hold in June.

When reporters questioned Cameron about the political jockeying that will no doubt take place in the coming months, the prime minister said—perhaps idealistically—that the ultimate outcome of the vote will depend on the will of the British people, who “must look at all arguments and make up their mind.” He acknowledged that the referendum is “the biggest question our generation will have to face,” but it is one “for the people, not the politicians.”