Osasuna - needing a win to have any chance of retaining their La Liga status - went ahead in the 12th minute of their game in Pamplona through Oriol Riera, but trouble followed in the ensuing goal celebrations.
A section of a protective barrier keeping fans in the stand collapsed and numerous supporters spilled over the edge and on to the area of the pitch behind the goal and advertising hoardings.
Security officials, medical staff and players of both teams quickly attended the scene to tend to any injured fans and several supporters were stretchered away for treatment.
A number of fans sustained injuries - the worst of which was a broken leg - and Osasuna president Miguel Achanco was relieved that nothing more severe happened.
"The security hasn't failed. I won't say there weren't too many people, but we put security guards there and we ask for the tickets," he is quoted as saying by AS.
"I saw there lots of fans in there, but if you send the security guards in there's an even bigger fuss. The responsibility is of each person, there is a risk.
"Today there was nothing worse than a broken femur, but it could have been a lot worse."
The rest of the barrier was momentarily removed after the incident and play eventually continued after a break of more than half an hour.