JERUSALEM — Prime Minister Benjamin Netanyahu was indicted Thursday on charges of bribery, fraud and breach of trust in a set of long-running corruption case s, throwing his political future into doubt and heightening the uncertainty and chaos surrounding Israel’s fitful, yearlong struggle to choose its next leader.

Mr. Netanyahu, 70, who in July became the longest-serving prime minister in Israel’s history, now also has the distinction of being the first to be indicted while in office.

The cases against Mr. Netanyahu involve allegations of giving or offering lucrative official favors to several media tycoons in exchange for favorable news coverage or gifts worth hundreds of thousands of dollars .

The indictment threatened to open a dangerous new challenge to Israel’s democracy, as the nation’s top prosecutor and its premier accused each another of subverting the rule of law.