The logistical concerns were endless. Mr. Rudin ticked through some: “Where does the cast go? How do the kids get in? How do you ticket it?”

He added, “What happens if, of the 18,000 kids, 5,000 of them wanted to go to the bathroom?”

(Some solutions: Part of the cast prepared in the visiting team’s locker room, and high school choirs were invited to sing during intermission to help keep students in the arena.)

The play brought its regular cast, including the actor Ed Harris, who took over the role of Atticus Finch from Jeff Daniels in November. He wasn’t the only celebrity present. Spike Lee was M.C., opening with the story of his own education in New York public schools, and Mayor Bill de Blasio and his wife, Chirlane McCray, also spoke.

As for the students, only about 3 percent of the public middle and high schoolers could fit, so the Department of Education granted admission to the first schools to respond to the invitations. The city intervened to make sure that all boroughs were well-represented, as well as schools that specialize in teaching students with disabilities, said Peter Avery, the director of theater for the department.

Some students had been assigned to read the original novel, but the drama diverges in some ways from Lee’s work. The play is framed around the trial, while readers do not get there until about halfway through the book. And the story’s most prominent black characters — Calpurnia and Tom Robinson — are allowed more opportunity in the play to voice their frustrations about racial injustice.