A row over Gibraltar has broken out after the UK triggered Article 50 to formally begin Brexit talks.

The EU's draft Brexit negotiating guidelines said that any decisions affecting Gibraltar would be run past Spain.

But how did Gibraltar become a British Overseas Territory?