STOCKHOLM — Since she burst onto the scene in 1945 with her mismatched socks, abundant freckles and two red braids sticking straight out of her head, Pippi Longstocking, a rambunctious, joyful girl strong enough to lift horses, has become a touchstone for generations of children who have read her in 65 languages worldwide.

In Sweden, Pippi is something more: a national treasure and embodiment of the country’s egalitarian spirit. So when the Swedish national broadcaster announced this fall that it would edit two scenes that it considered offensive in a 1969 television series about Pippi — including one in which she says her father is “king of the Negroes,” using a Swedish word now viewed as a racial slur — it hit a nerve.

The series was based on the Pippi Longstocking books by Astrid Lindgren, the first of which were published between 1945 and 1948. Defenders of the decision, including the heirs of Ms. Lindgren, who died in 2002, said the change respected the spirit of the author. Even in 1970, she had called the term outdated and said she had not meant to offend. But many others — influential opinion columnists and tens of thousands of people who answered a Facebook poll on the website of Sweden’s largest daily newspaper this fall — said they opposed the revision, some accusing the broadcaster, SVT, of politically correct censorship.

Coming just weeks after a hard-right party with skinhead roots won an unprecedented 13 percent of the vote in national elections, and following other recent controversies over caricatures in children’s books in Sweden, the Pippi flap has tapped into a growing and often uncomfortable debate. It concerns ethnicity in a country that prides itself on its egalitarianism but in which ethnic minorities, a small percentage of the country’s nine million people, have only recently begun to have a voice.