Barcelona star Lionel Messi has become the club's all-time leading goal scorer.
Barca were given a scare by Granada before winning 5-3 to move within five points of Primera division leaders Real Madrid.
Messi broke the club record of 232 official goals set by Cesar Rodriguez during the 1940s and 50s when he coolly lobbed home his second of the match in the 67th minute to put Barca back in the lead after Granada had fought back from two down to 2-2.
Barca substitute Cristian Tello then added a fourth before Messi completed his eighth hat-trick of the season in the 86th minute to put his side 5-2 ahead.
There was still time after that for Granada, who had cancelled out early strikes from Xavi and Messi with second-half goals from Diego Mainz and Guilherme Siqueira, to pull another goal back when Siqueira slotted in his second penalty of the night after Dani Alves had been sent off.