Swansea City saw off a spirited display from Barnsley to progress to the FA Cup fourth round after a six-goal thriller.
Goals from Rangel, Dyer and Graham cancelled out Vaz Te's two strikes to ensure the Premier League club didn't suffer an upset at the hands of Keith Hill's men.
Swansea started the better, forcing Barnsley keeper Luke Steele into a few saves early on, but it was the Championship side that made the breakthrough.
Former Bolton striker Ricardo Vaz Te continued his good goal-scoring form to put Barnsley ahead with a well-struck shot from the edge of the penalty area in the 29th minute.
The lead lasted for less than two minutes, however, as Swansea immediately went on the attack and found an equaliser through Angel Rangel.
It stayed level until half time, but not for long after it as Danny Graham hit a stunning 30-yard strike into the top corner less than two minutes after the restart.
The Swans soon doubled this lead when Wayne Routledge broke down the left flank and pulled the ball back for Nathan Dyer to sweep home.
Barnsley still refused to lie down and went pushing for a goal to get them back in the game. Less than ten minutes after Dyer made it 3-1, Vaz Te got his 12th goal of the season to give Barnsley some hope.
Despite their continued efforts, however, they couldn't get the equalising goal, and their hopes were dashed when Danny Graham reopened the two goal lead in the 89th minute.