ISTANBUL — Confronted with widespread protests two summers ago, Prime Minister Recep Tayyip Erdogan ordered a harsh police crackdown and tarnished the demonstrators as traitors and spies. Faced with a corruption inquiry focused on his inner circle, he responded by purging the police and judiciary.

So when Mr. Erdogan, now president, suffered a stinging electoral defeat in June that left his party without a majority in Parliament and seemingly dashed his hopes of establishing an executive presidency, Turks were left wondering how he would respond.

Now, many say they have their answer: a new war.

As Turkey resumes military operations against the separatist Kurdistan Workers’ Party, or P.K.K., analysts see a calculated strategy for Mr. Erdogan’s Islamist-rooted Justice and Development Party to regain its parliamentary majority in new elections.

Having already delayed the formation of a coalition government, analysts say, Mr. Erdogan is now buttressing his party’s chances of winning new elections by appealing to Turkish nationalists opposed to self-determination for the Kurdish minority. Parallel to the military operations against the Kurds has been an effort to undermine the political side of the Kurdish movement by associating it with the violence of the P.K.K., which has also seemed eager to return to fighting. The state battled the group for three decades at a cost of about 40,000 lives before a fragile peace process began in 2013.