WARSAW, Poland — Winning a Nobel Prize in Literature is usually a cause for celebration in the writer’s home country, a point of pride and a justification for a bit of patriotic pomp. But in Poland, where the nation is engaged in a bitter and consequential battle over the question of what it means to be Polish, the prize has led to controversy, instead.

When Olga Tokarczuk of Poland won it on Thursday, the reaction was as divided as is the country itself. To some, she is an eloquent writer who captures Poland’s tragic and inspiring 20th-century history. To others, she is a traitor.

Ms. Tokarczuk has documented Poland’s long history of pluralism and ethnic mixing at the same time as her government has cast migrants as a mortal danger to the nation. She has denounced attacks on gays and globalists, even as leaders in Poland’s governing Law and Justice Party have sought to convince voters that a “rainbow plague” backed by decadent Western leaders presented an existential threat to both families and the nation itself.

So with national elections scheduled to take place in Poland on Sunday, perhaps it was not surprising that Poland’s competing factions sought to use the prize announcement to bolster their own sides.