No exploding planet, death of a relative or irradiated spider led to Kamala’s creation. Her genesis began more mundanely, in a conversation between Sana Amanat and Steve Wacker, two editors at Marvel. “I was telling him some crazy anecdote about my childhood, growing up as a Muslim-American,” Ms. Amanat said. “He found it hilarious.” Ms. Amanat and Mr. Wacker noted the dearth of female superhero series and, even more so, of comics with cultural specificity.

When they told G. Willow Wilson, an author, comic book writer and convert to Islam, about their idea, she was eager to come on board as the series’ writer. “Any time you do something like this, it is a bit of a risk,” Ms. Wilson said. “You’re trying to bring the audience on board and they are used to seeing something else in the pages of a comic book.”

Kamala, whose family is from Pakistan, has devotedly followed the career of the blond, blue-eyed Carol Danvers, who now goes by Captain Marvel, a name she inherited from a male hero. When Kamala discovers her powers, including the ability to change shape, she takes on the code name Ms. Marvel — what Carol called herself when she began her superhero career.

“Captain Marvel represents an ideal that Kamala pines for,” Ms. Wilson said. “She’s strong, beautiful and doesn’t have any of the baggage of being Pakistani and ‘different.’ ”

Ms. Amanat said, “It’s also sort of like when I was a little girl and wanted to be Tiffani-Amber Thiessen,” from “Saved by the Bell.”

Kamala will face struggles outside her own head, including conflicts close to home. “Her brother is extremely conservative,” Ms. Amanat said. “Her mom is paranoid that she’s going to touch a boy and get pregnant. Her father wants her to concentrate on her studies and become a doctor.” Next to those challenges, fighting supervillains may be a respite.

The creative team is braced for all possible reactions. “I do expect some negativity,” Ms. Amanat said, “not only from people who are anti-Muslim, but people who are Muslim and might want the character portrayed in a particular light.”