On Sunday, the leaders of the 28 EU countries are expected to meet in Brussels at a carefully choreographed summit to approve Brexit plans and an accompanying political declaration on the future ties between Britain and the 27 EU nations that will say goodbye officially in March.
The Brexit package, which is very much the British Prime Minister Theresa May's deal, has been painstakingly crafted. But it's been a tortured path: 17 months of sometimes bitter negotiations, nonstop bickering within May's own leadership team, ongoing concerns about how to handle the border between EU-member Ireland and North Ireland, the resignation of a string of ministers including two Brexit secretaries, and a new vocabulary of Brexit-related puns and put-downs from British tabloids.
Around 30,000 Britons live in Gibraltar, a 2.6-square mile rocky outpost that shares a land border with Spain. It was famously the headquarters for Gen. Dwight D. Eisenhower during the planning stages of the Allied invasion of North Africa in 1942.
The sovereignty issues around Gibraltar may have hit the headlines this week, but they are long-festering. Gibraltar was ceded to Britain in 1713 under the Treaty of Utrecht, but it is still claimed by Spain. In a 2002 referendum, its citizens overwhelming rejected a proposal of joint British-Spanish rule, instead opting to remain under the sovereignty of Britain only.
But the two countries have deep ties with each other - an estimated 12,000 workers cross the border every day. In the 2016 EU referendum, Gibraltarians voted 96 percent to remain in the European Union.
May has said that any Brexit deal must apply to the "whole U.K. family," including Gibraltar.
Spain can't officially "veto" the withdrawal agreement, a 585-page legally-binding agreement, but the European Union has worked hard at presenting a united front during Brexit negotiations and it wanted a consensus on Sunday.
Donald Tusk, the president of the European Council, tweeted on Saturday afternoon that there was unity and solidarity from the EU side. He added: "No one has reasons to be happy."
Even with the Gibraltar issue solved at the 11th hour, May's headaches are far from over. If the deal is signed off in Brussels this weekend, as expected, May still needs to convince the majority of British lawmakers to back her deal - arguably her biggest challenge yet.