Ever since Kosovo ended its war with Serbia two decades ago, most of its dominant political figures have been men who rose to prominence as fighters and held onto power despite failing to secure a lasting peace and presiding over a floundering economy.

But in parliamentary elections on Sunday, a new generation of politicians offered them a serious challenge for the first time. Opposition parties gained ground and the ruling party appeared to take a solid beating at the polls, according to Kosovo Election Commission projections based on 80 percent of votes counted on Sunday night.

While the bitter division with Serbia remains — the government in Belgrade refuses to recognize Kosovo as an independent nation — and hope for a rapprochement still far-off, observers hope that the vote might provide an opportunity for the country to shake off the corruption and mismanagement of the postwar years and focus on better governance.

“This is an opportunity for the new generation of politicians to break the cycle of using Serbia as an excuse for the mistakes of Kosovo’s governments,” said Lulzim Peci, the director of the Kosovar Institute for Policy Research and Development in Pristina.