Cardozo High School English teacher Frazier O'Leary with students in this 2008 file photo. (Bill O'Leary/The Washington Post)

I first encountered Frazier L. O’Leary Jr. in 1999 when I was following one of his students for several months. It was an unscientific experiment. How well was Candy Parrish being educated at low-performing Cardozo High School in the District, compared with two similarly ambitious 11th-grade girls — one at a high-performing Fairfax County school and one at a Prince George’s County school somewhere in the middle?

The student getting the most challenges and the best teaching turned out to be Parrish, at Cardozo. Her school was in a creaky old building and at the bottom of the academic heap. But it had O’Leary, who was teaching a very challenging Advanced Placement English literature course and showing students how to organize their lives for success.

O’Leary, 72, is retiring this year. For 47 years, he has been teaching teenagers a great deal by giving them much more time and encouragement to learn than they are used to. He has been a longtime consultant and exam reader for the College Board’s AP program, vice president of the board of the PEN/Faulkner Society, a charter member of the Toni Morrison Society and the Cardozo baseball team head well as a frequent football and basketball game announcer.

I have never met a teacher who loved his job and his students more than O’Leary. In class, you hear him nudge students beyond the literal meaning of novels by Morrison and Edward P. Jones. But an equally characteristic remark from O’Leary is: “Get out of my face because you are not dropping this class.”

This school year, backed by Principal Tanya Roane and Assistant Principal Tynika Young-Aleibar, O’Leary enrolled every senior in a required AP English lit course at the now beautifully remodeled Cardozo campus. Almost no inner-city schools ever try that. O’Leary students rarely pass the AP exam, but they do much more writing than they would in a regular course and have a better chance for success in college and the workplace.

He says he plans to continue raising money for the Cardozo AP Scholarship Foundation, which gives grants to students who put in extra effort. He will stick with PEN/Faulkner, which arranged for classroom talks to O’Leary’s students by many authors, including Chimamanda Ngozi Adichie, George Pelecanos, Tim O’Brien, Richard Rodriguez, Jones and Morrison.

O’Leary’s retirement will not free his former students from his influence. He checks in with them and holds an annual reunion where he urges them ahead in whatever they are doing.

Word of that gets around, even among cynical teenagers, and has impact. “I remember a senior student who would always come to class late and never seemed to care,” said Amery Stapleton, who co-taught an AP writing class with O’Leary. “One statement of disappointment from Dr. O’Leary and the student immediately changed her behavior. He is absolutely inspiring for teachers and students alike.”

Former O’Leary student Shermaine Mitchell-Ryan, a policy fellow at the American Association for the Advancement of Science, said, “He allowed me to draw connections and appreciate existing parallels in . . . characters or themes from the likes of Shakespeare, Walt Whitman and other writers that experienced a life that is a significant departure from my own.”

O’Leary said he has tried to help new teachers correct a significant failing. “They have no clue about how to adjust to students who don’t look like them or have life experiences that are foreign to them. In order to be successful at this job, it has to grow on you,” he said.

O’Leary said his students “have accepted the rigor of an AP course, grudgingly at first, and have made giant leaps in their skills. There is no reason why this cannot be a systemwide accomplishment.” He said D.C. Schools Chancellor Antwan Wilson has indicated that he feels the same way.

Over nearly a half-century, a teacher like O’Leary can show many students how to go deep even when the education system is so shallow. Thousands of other educators are carrying that message to their classrooms, perhaps the best thing happening in schools today.