The EU and Britain on Tuesday signed a deal ending border checks between Gibraltar and Spain six years after the UK left the bloc.