Spain's main opposition party has reacted angrily to moves by London and Madrid to give Gibraltar an equal say over the future of the Rock.
Gibraltar's residents recently celebrated 300 years of being British
For the first time, the British territory will be allowed to represent itself in inter-governmental talks with the UK and Spain.
But Mariano Rajoy, leader of the Popular Party, says giving Gibraltar a veto is "simply humiliating".
The first meeting of the three sides is due to take place in January.
The UK has held Gibraltar since 1704. Spain ceded sovereignty in 1713 but has repeated claims to the territory at its southern tip.
A statement released by Spain, the UK and Gibraltar on Thursday said: "Each of the three parties will have its own, separate voice and each will participate on the same basis."
The Popular Party wants to confirm that the latest developments did not violate United Nations protocols on Gibraltar and or the Treaty of Utrecht itself, under which Spain ceded
the territory to Britain.
"It's crazy, a unilateral decision, a very grave error," said Mr Rajoy. "We will ask the prime minister to explain this to us."
Gibraltar's Chief Minister Peter Caruana said the agreement "fully delivers our conditions for participation in safe and reasonable dialogue".
Two years ago, voters in Gibraltar overwhelmingly rejected the option of Britain and Spain sharing sovereignty over the territory in a referendum organised by the local government. The referendum was not recognised by either Britain or Spain.