Los Blancos, who were two goals down at half time, were being beaten 4-1 on aggregate and appeared to be all but out of the tie. However, Madrid forwards Karim Benzema and Cristiano Ronaldo found the back of the net after the break to fire the visitors back to within one goal of the next round.
While Barcelona were able to hold on, Alves admitted that it was difficult.
"We knew we had to suffer until the end," he told reporters. "This version of Real Madrid is the one that gives us the most problems.
"They were phenomenal. They create a lot of pressure, closed down very well and made it very hard for us to attack.
"The most important thing is that we are through. We knew this tie would be decided in both matches, not just the first one."
Barcelona will now face the winner of Levante and Valencia for a place in the final.