It took 26 publisher rejections before Madeleine L’Engle could finally get “A Wrinkle in Time” into print in 1962. The book was an instant hit, winning the Newbery Medal the following year.

Despite its wild success, L’Engle still had fierce critics.

Perhaps most critical were some conservative Christians who believed that the book promoted the occult or mystical elements. While L’Engle considered herself a devout Christian, and sprinkled the book with scriptural references, she was accused of promoting witchcraft —‚ an accusation made later against “Harry Potter” author J.K. Rowling.

The accusations didn’t stop the book from being popular for more than 50 years.

A Disney film adaptation of “A Wrinkle in Time,” which opens Thursday, stars Oprah Winfrey, Reese Witherspoon, Mindy Kaling, Chris Pine and Zach Galifianakis, and is directed by Ava DuVernay of “Selma.” In the story, 13-year-old Meg Murry is guided by three angelic beings on a quest to find her father, a scientist who had gone missing.

“If I’ve ever written a book that says what I feel about God and the universe, this is it,” L’Engle wrote in her journal about “A Wrinkle in Time.” “This is my psalm of praise to life, my stand for life against death.”

Before she died in 2007 at age 88, L’Engle was the rare writer who ran in both liberal mainline Protestant circles and elite literary ones in New York City, and who also made conservative evangelical fans around the country. L’Engle was part of an exclusive society of authors, including Eugene Peterson, Richard Foster and Philip Yancey, who are popular among evangelical readers.

“Faith is what makes life bearable, with all its tragedies and ambiguities and sudden, startling joys,” L’Engle wrote in her book “Walking on Water: Reflections on Faith and Art.”

L’Engle is sometimes compared with 20th-century British author C.S. Lewis, who wrote popular children’s literature, as well as books defending and explaining the Christian faith. She graduated from Smith College and a collection of her papers is held at Wheaton College, the evangelical school in the Chicago suburbs that also holds some of Lewis’ papers.

She wrote that publishers had trouble with “A Wrinkle in Time” “because it deals overtly with the problem of evil, and it was too difficult for children, and was it a children’s or an adult’s book, anyhow?”

Claris Van Kuiken, a member of the Christian Reformed Church, wrote a 1996 book titled “Battle to Destroy Truth,” taking on L’Engle’s work specifically and tying it to New Age spirituality. She argued that L’Engle’s works “preserved the ‘ancient wisdom’ or ‘secret doctrine’ condemned by God himself.”

L’Engle was baffled and frustrated by some of the vitriol she faced from fellow Christians, her granddaughter Charlotte Jones Voiklis said Wednesday. Though she once considered herself an atheist, after L’Engle became a Christian, she had a daily practice of reading the Bible and praying. Her granddaughter said L’Engle’s coming to her faith was slower “acceptance of what she had always known to be true” rather than a sudden conversion moment.

“She was a Christian because she was deeply rooted in its traditions and language,” Voiklis said, “and she was moved by and trusted in its stories.”

Though she did not like denominational labels, L’Engle mostly attended Episcopal churches, serving for about four decades as a librarian and writer-in-residence at the Cathedral of St. John the Divine in New York City, an Episcopal church and one of the largest cathedrals in the world.

“The themes that are important in Christianity permeate her writing, [including] good and bad, light and darkness,” said the Rev. Patrick Malloy, subdean of the cathedral. “She was open to questions and to looking at new ways to say old things.”

In the 1990s, L’Engle began attending Sunday services at All Angels Church, an Episcopal Church on Manhattan’s Upper West Side known for attracting artists. She wanted the smaller community of All Angels, but still attended noon prayer and Evensong services at St. John the Divine, Voiklis said.

Voiklis, who co-wrote “Becoming Madeleine,” said her grandmother’s faith informed everything she wrote, including numerous books, plays and poems.

“She preferred scientific metaphors, and scientists to theologians, because she understood that science is more open to revelation than religion,” Voiklis said. “Religion divides us into teams.”

L’Engle wrote that “A Wrinkle in Time” was her rebuttal to German theologians, whom she complained were too rigid in their answers to cosmic questions. “It was also my affirmation of a universe in which I could take note of all the evil and unfairness and horror and yet believe in a loving Creator,” she wrote in “Walking on Water.”

But some conservative Christians took offense to elements of “A Wrinkle in Time,” including what they saw as relativism. The book lists Jesus alongside the names of famous artists, philosophers, scientists and Buddha.

The idea of conformity is one of the major themes in the novel, which was published during an era when Communism thrived. Conservative Christians were not only confused by the book, said Don Hettinga, an English professor at Calvin College, but they also proved its point by forcing conformity to a certain way of thinking.

L’Engle was not afraid to push buttons, said Luci Shaw, a poet and a friend of L’Engle’s for more than three decades. She said L’Engle was a universalist, believing that all humankind will be invited into heaven, and she loved gay people at a time when many Christians were suspicious of them.

“Many conservative churches draw a circle, and certain people can’t enter the circle because they haven’t been baptized or committed themselves to Christ,” Shaw said. “Jesus drew a circle that was much bigger and it included everybody. She had a broad sense that we’re all in this together, that God’s love is the power that runs the world.”

In some ways, L’Engle could be compared to Marilynne Robinson, the Pulitzer Prize-winning author of “Gilead”; a member of the liberal-leaning United Church of Christ, she still finds fans among conservative evangelicals. But L’Engle was likely more controversial because she was writing for children, said Sarah Arthur, author of a forthcoming biography of L’Engle titled “A Light So Lovely.”

“If Madeleine had backed off from theology, it would’ve been safer,” Arthur said. Her literary friends often didn’t understand why she had to write so much about faith, Arthur said, while she received criticism from some conservative Christians. Yet she straddled both the Christian publishing world and a non-religious publishing world in ways most authors cannot.

Hollywood has sometimes struggled with films that have spiritual or religious undertones. The film “Noah” received backlash for its loose interpretation of biblical narratives. “Of Gods and Kings,” about Moses, was criticized for whitewashing the characters. And some filmmakers don’t include religion at all: Angelina Jolie’s film “Unbroken,” an adaptation of Laura Hillenbrand’s book on Olympian Louis Zamperini, did not include his Christian conversion.

Early reviews of “A Wrinkle in Time” are mixed, drawing a 43 percent rating on Rotten Tomatoes. And a film starring Oprah, who is also controversial among some conservative Christians, might not attract the same kind of crowd that soaked up films like “Passion of the Christ,” “The Blind Side” and Disney’s adaptation of Lewis’ “The Lion, the Witch and the Wardrobe.”

Arthur fears that the film could turn L’Engle’s work into a “‘power of positive thinking’ approach to spirituality.”

“There are a lot of people who believe the strength that you need to fight the darkness is in you,” Arthur said. “But it’s because they were connected to the source of light who is Jesus. If it’s unmoored from Madeleine’s Christian faith, it’s missing a big piece of the spiritual thrust of what she was doing.”

The film, which preserves “a more vague spirituality,” makes no effort to appeal to the movie-going audience that typically flocks to Christian movies, writes Alissa Wilkinson, a film critic at Vox and an English professor at The King’s College in New York City. Instead of including particulars about many religions, Wilkinson writes, the film smooths “them all out into a vague swirl of ‘love.’ “

Would L’Engle have liked Hollywood’s adaptation? Her granddaughter, who saw an early version, said it gave her the “same feelings of inspiration and optimism” as the book.

Hettinga, who had not seen the film, believes L’Engle would have loved the reinterpretation that made the main character, Meg Murry, a black girl from an interracial marriage. For its time, L’Engle’s book was groundbreaking by portraying Murry’s mother as a well-educated scientist with two doctoral degrees.

“I’m not expecting a one-to-one literalism but something that captures the spirit of the book,” Hettinga said. “I think she would like something that caught the spirit and wouldn’t try to be literal.”