What was taken out of schools first, the Pledge of Allegiance or prayer?
State-sponsored prayers in public schools were banned by the Supreme Court of the United States in 1962. This was done in the case of Engel v. Vitale. Students are, of course, free to pray silently whenever they wish. Therefore, it is not really accurate to say that prayer has been taken out of schools.
The Pledge of Allegiance has not been taken out of schools in any way. It remains legal to have a school-mandated recitation of the Pledge of Allegiance. The only limitation on this is that students may not be required to recite the Pledge.
So, of these two, school-sponsored prayer has been banned, but the Pledge of Allegiance has not.