The home side has another chance on 22 minutes through David Villa, but the forward could only hit his shot straight at the goalkeeper.
Barcelona began to dominate proceedings and came close on a number of occasions through Villa, Iniesta and Jordi Alba - although none of them really tested the goalkeeper with their efforts.
Cristian Tello almost gave Barca the lead on 41 minutes, but his strike hit the bar and bounced clear.
Two minutes later, Betis shocked the home side again when they took the lead through Perez on 43 minutes.
Barcelona drew level on 56 minutes through a header from David Villa from a Daniel Alves cross.
Four minutes later, the home side completed their comeback when Lionel Messi made it 3-2.
© AP Photos
Messi came close to extending the lead further on 69 minutes, but his effort bounced clear off the bar.
Two minutes later, Messi did grab a fourth goal, finishing well from a Sanchez assist to secure the points.