WARSAW — The populist message of Poland’s governing party — steeped in religion, bound by traditional values and animated by historical grievance — failed to gain ground in Warsaw in elections on Sunday, a sign that the party may not have broadened its support among more moderate voters.

According to exit polls, the party also did not appear to gain support in most of Poland’s other major cities. But it showed strength in poor and rural communities where its message has its deepest resonance, the exit polls suggest.

The elections, for local and provincial offices, were the first nationwide since the Law and Justice party swept to power in parliamentary elections in 2015.

It could take up to two days for all the votes to be tallied and official results released. While the parties and local news media rely heavily on exit polling, conducted by the international market research firm IPSOS, they provide only a rough guide.