The animals charged over people who had fallen in the entrance and were piled on top of each other, The Associated Press reported.
One bull had fallen before the entrance but got up and charged through the narrow passageway, while two more steers jumped over panicked thrill-seekers as they got up and began to flee.
The rest of the animals were herded into a side entrance of the arena.
Local government minister Javier Morras told AP that authorities were analyzing exactly what caused the pileup, which was broadcast live on public television.
Two of the 23 injured were gored, while the rest were hurt in the stampede.
One runner, a 19-year-old Spaniard, was seriously injured after his thorax was crushed at the entrance to the bullring,according to the AP.
Three men were gored during Friday's run, including an American college student who had to have his spleen removed.
Pamplona's week-long running of the bulls dates back to the 16th century.
Gorings are fairly common, but stampedes are rare. The last fatal goring was in 2009.