Rachel Held Evans, a best-selling author who challenged conservative Christianity and gave voice to a generation of wandering evangelicals wrestling with their faith, died on Saturday at a hospital in Nashville. She was 37.

Her husband, Daniel Evans, said in a statement on her website that the cause was extensive brain swelling. During treatment for an infection last month, Ms. Evans began experiencing brain seizures and had been placed in a medically induced coma.

“I keep hoping it’s a nightmare from which I’ll awake,” Mr. Evans said in a statement. “Rachel’s presence in this world was a gift to us all, and her work will long survive her.”

An Episcopalian, Ms. Evans left the evangelical church in 2014 because, she said, she was done trying to end the church’s culture wars and wanted to focus instead on building a new community among the church’s “refugees”: women who wanted to become ministers, gay Christians and “those who refuse to choose between their intellectual integrity and their faith.”