Barcelona secured a third consecutive Supercopa following a 5-4 win on aggregate against their closest rivals, Real Madrid.