JERUSALEM — The Israeli president on Thursday handed the task of forming a government to Parliament, starting a 21-day countdown that could lead to new elections, after Prime Minister Benjamin Netanyahu and his chief rival, Benny Gantz, missed another midnight deadline to reach a power-sharing agreement.

The step, which was mainly technical, on its own does little to find a way through Israel’s yearlong political impasse. Neither Mr. Netanyahu nor Mr. Gantz can currently muster a majority without joining forces, and their parties issued a joint statement on Thursday saying that negotiations for a unity government would continue.

But the step taken by the president, Reuven Rivlin, set a timer: By law, lawmakers have 21 days to come up with a viable government, whether a unity coalition or some other configuration. Failing that, Parliament will automatically disperse on May 7 and, for the fourth time in little over a year, send Israelis back to the ballot box.

The last election, on March 2, produced no clear winner. Mr. Netanyahu, Israel’s longest-serving prime minister and leader of the conservative Likud party, has beseeched Mr. Gantz, a former army chief who is leader of the centrist Blue and White party, to join him in a national emergency government to contend with the coronavirus crisis.