JERUSALEM — Fighting for his future, Prime Minister Benjamin Netanyahu of Israel on Wednesday asked Parliament to grant him immunity from prosecution in three graft cases, a rare and contentious step that critics say violates the principle of equality before the law.

The immunity request is the latest twist in the political and legal drama that has paralyzed the Israeli government.

Long famed for his survival skills, Mr. Netanyahu is taking the risky move to fend off charges that imperil his legacy and could eventually land him in prison. But the effort also threatens to further polarize a divided nation and prolong the political deadlock that has left the country without a fully functioning government for nearly a year.

Submitted barely three hours before the legal deadline, the immunity request could delay for months the criminal cases against Mr. Netanyahu, who faces a general election in two months, the country’s third in less than a year. If it is approved, immunity could keep him out of court for as long as he remains a member of Parliament.