JERUSALEM — In a pugnacious speech on Wednesday evening before thousands of supporters, Prime Minister Benjamin Netanyahu of Israel, embroiled in graft investigations, railed against “the left” and “the media that serves it,” contending that they had ganged up to overthrow him.

The occasion was a rally intended as a show of strength organized by loyalists from Mr. Netanyahu’s conservative Likud Party. Government ministers, legislators and about 3,000 activists attended, hoping to counter a growing sense in Israel that Mr. Netanyahu’s long political career could be edging to an ignominious close.

After one of Mr. Netanyahu’s closest former aides recently turned state’s witness in two cases involving suspicions of bribery, fraud and breach of trust, analysts said it appeared more likely that the prime minister would ultimately be charged.

Timed for the main evening television news broadcasts and carried live, Mr. Netanyahu’s address was partly a campaign speech and, some commentators said, partly a warning to potential rivals from within the party who might be planning on his political demise.