Barca beaten in nine-goal thriller