Mrs May said her approach to negotiations was “definitely jaw jaw”.
On Sunday ex-Tory leader Lord Howard said the PM would defend Gibraltar in the same way as Margaret Thatcher defended the Falklands in the 1982 war.
Spain’s foreign minister said his government was “surprised by the tone of comments coming out of Britain”.
“It seems someone is losing their cool,” Alfonso Dastis told a conference in Madrid.
The current row was sparked by draft Brexit negotiating guidelines published by the EU last Friday saying any decisions affecting Gibraltar would be run past Spain.
The guidelines said: “After the United Kingdom leaves the Union, no agreement between the EU and the United Kingdom may apply to the territory of Gibraltar without the agreement between the Kingdom of Spain and the United Kingdom.”
Speaking to reporters on a flight to Jordan, Mrs May was asked if – borrowing from a phase used by Winston Churchill – Britain’s approach should be described as “jaw jaw, not war war”.
“It’s definitely jaw jaw,” replied the PM, who laughed when asked to rule out a war with Spain.
“What we are doing, with all EU countries in the EU is sitting down and talking to them,” she said.
“We’re going to be talking to them about getting the best possible deal for the UK and for those countries – Spain included.”
Mrs May said British policy on Gibraltar had not, and would not, change.
Gibraltar: key facts
- Gibraltarians are British citizens but they run their own affairs under a chief minister
- The territory is self-governing in all matters – including taxation – except foreign policy and defence, which are dealt with by the UK government
- Despite its small size, Gibraltar is strategically important, standing only 12 miles from the north coast of Africa. It has a UK military base, including a port and airstrip
Gibraltar’s chief minister Fabian Picardo said: “Gibraltar is not a bargaining chip in these negotiations. Gibraltar belongs to the Gibraltarians and we want to stay British.”
Mr Picardo urged European Council President Donald Tusk to remove the reference to Gibraltar.
“Mr Tusk, who has been given to using the analogies of the divorce and divorce petition, is behaving like a cuckolded husband who is taking it out on the children,” he said.
The EU’s guidelines followed a letter from Mrs May formally triggering Brexit talks, which did not mention Gibraltar directly.
Lord Howard raised the spectre of military action, saying that 35 years ago, “another woman prime minister sent a taskforce halfway across the world to protect another small group of British people against another Spanish-speaking country.
“And I’m absolutely clear that our current woman prime minister will show the same resolve in relation to Gibraltar as her predecessor did.”
After Argentina invaded the Falklands in 1982, Margaret Thatcher sent a task force to reclaim the islands, in the South Atlantic.
An estimated 655 Argentine and 255 British servicemen lost their lives in the fighting that followed.
Former Labour foreign secretary Jack Straw, whose 2002 referendum asking Gibraltarians if they wanted Britain to share sovereignty with Spain was rejected by 99% to 1%, dismissed the threat of military action as “frankly absurd and reeks of 19th century jingoism”, adding that Britain leaving the EU would result in “all sorts of problems” popping up.
“For the Spanish, Gibraltar is an affront to their sense of national identity and their sense of sovereignty – it’s a bit like having a part of Dover owned by Spain,” he told BBC Radio 4’s Today programme.
Mr Straw said while Britain was in the EU “we held equal cards with Spain”, but once it left, the situation would be reversed, with the 27 EU nations “holding the cards”.
Lib Dem leader Tim Farron said of Lord Howard’s comments: “In only a few days the Conservative right are turning long-term allies into potential enemies.”
But Brexit Secretary David Davis, in Spain for meetings with members of its government, said Lord Howard was expressing the “resolve” of the UK in supporting the sovereignty of Gibraltar. He made it clear any talk of Falklands style taskforces “wasn’t going to happen”.
Spain has long contested Britain’s 300 year-rule of Gibraltar, which has a population of about 30,000.