With most superheroes, when you take away the colorful costume, mask and cape, what you find underneath is a white man. But not always. In February, as part of a continuing effort to diversify its offerings, Marvel Comics will begin a series whose lead character, Kamala Khan, is a teenage Muslim girl living in Jersey City.

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.