LOS ANGELES - Early on in "The First Grader," an ancient man, as hard and lean as his walking stick, strides miles across the coarse Kenyan bush. When he gets to his destination - a rural primary school - the gate is already locked, leaving him to stand alone on one side, with everything he wants on the other.

So begins the film based on the life of Kimani Ng'ange'a Maruge, an illiterate 84-year-old Kenyan whose fight to be admitted to the school in 2003 became a Los Angeles Times story and a worldwide sensation. Before it was over, his struggle would alienate neighbors, test teachers, inconvenience politicians, spark violence, trigger a public debate and ultimately turn him into the poster child for the power of education.

Anchored by a lovely performance from Oliver Litondo as Maruge and an exuberant Naomie Harris as Jane Obinchu, the school principal who champions his cause, the result is a tearful, joyful, imperfect, yet nearly irresistible ode to the human spirit.

The filmmakers - director Justin Chadwick ("The Other Boleyn Girl") and screenwriter Ann Peacock ("The Chronicles of Narnia: The Lion, the Witch and the Wardrobe") for the most part, have put enough real-world grit in the story to help a heaping sentimental spoonful go down.

Using a rangy mix of humor, terror, defiance and irony, the film moves between Maruge's memories of his life as a young father and warrior in the Mau Mau rebellion against British colonialism and his later days' determination to read. The past is the film's weakest link as the filmmakers reduce a complicated history of tribal conflicts, British rule and Maruge's experience to a shorthand of images that raise more questions than they answer. In contrast, the school, though simple, impoverished and covered by a layer of desert dust, has such vibrancy it lifts the film every time the director returns there.

Though this is one man's story, the film is peppered with eccentric characters. The scene stealers are Maruge's young classmates - a mishmash of soulful eyes, cherubic smiles and mischief - all cast from the Rift Valley school in Kenya where the film was shot. In showing the kids, as well as Maruge, bloom under Teacher Jane, as she is called, the film captures the essence of why education is so empowering, why learning to read was worth Maruge's fight.

The film as a whole would have been better served if the director had kept his focus on the school - that might have turned this very good effort into an A.

Produced by Sam Feuer, Richard Harding, David M. Thompson, directed by Justin Chadwick, written by Ann Peacock, music by Alex Heffes, distributed by National Geographic Entertainment.