Tottenham were left stunned as they were knocked out of the FA Cup by a resilient and much better performing Middlesbrough.