"I am confident that through the necessary dialogue and effort our two governments will be able to work... Towards arrangements that are acceptable to all involved," Felipe told the British parliament.
Referring to the history of diplomatic relations between Britain and Spain, he said: "I am certain that this resolve to overcome our differences will be even greater in the case of Gibraltar."
With a population of just over 32,000, Gibraltar has been a British overseas territory since 1713 but Spain has long laid claim to the rocky outcrop.
But Spain wants shared sovereignty and the EU has promised Spain a veto over the extension to Gibraltar of any future trade deal between Britain and the bloc, sparking a storm of outrage in London.
Also Read
Gibraltar's chief minister Fabian Picardo reacted scathingly, saying: "What the king has said really harks back to a time when the governments in Madrid and London might make decisions over the heads of the people of Gibraltar."
The king's speech was overwhelmingly conciliatory, speaking about shared history between the two countries as well as joint efforts against terrorism after four attacks in Britain this year.
He said Brexit "saddens" Spain but that it fully respected the result of last year's vote.
Felipe spoke about the hundreds of thousands of Spaniards living in Britain and Britons living in Spain, whose future hangs in the balance as Britain negotiates its withdrawal from the EU.
There are an estimated 3,00,000 British citizens living in Spain -- the majority of them retirees -- and around 1,16,000 Spaniards living in Britain.
The king spoke at length to express sympathy with the victims of the recent terror attacks in Britain.
A Spaniard was among the eight people killed in an attack by three Islamist sympathisers wielding knives and wearing fake suicide vests in the London Bridge area last month.
The king said Echeverria had behaved in "an exemplary and heroic manner".
The visit by Felipe and his wife Queen Letizia was delayed twice, once while Spanish politicians formed a new government last year and again last month because Britain held a snap general election.
The Spanish royals were greeted today by Queen Elizabeth II -- a distant cousin of Felipe -- at an elaborate ceremony in central London.
They are due to attend a banquet at Buckingham Palace later today and Felipe will meet British Prime Minister Theresa May tomorrow where the subject of Gibraltar could be raised again.
Disclaimer: No Business Standard Journalist was involved in creation of this content