CAIRO — Israel’s two leading centrist candidates for prime minister, Benny Gantz and Yair Lapid, joined forces on Thursday to try to defeat Benjamin Netanyahu, the right-wing leader who has led the country for a decade, in a move that instantly makes the April 9 elections far more competitive.

Mr. Gantz, a retired military chief of staff who entered politics only weeks ago, and Mr. Lapid, a former finance minister who founded the Yesh Atid (There Is a Future) party in 2012, agreed to take turns as prime minister if elected, with Mr. Gantz holding that job and Mr. Lapid serving as foreign minister for the first two and a half years before switching roles.

“A winning team needs to be led,” Mr. Lapid said at a rollout of their combined slate of candidates in Tel Aviv. “I wouldn’t be standing here today if I didn’t believe that Benny Gantz could lead us to victory and then lead the country. He’ll be an excellent prime minister. I believe in him.”

Saying that “Israel has lost its way” under Mr. Netanyahu’s “government of divide and conquer,” Mr. Gantz promised a restoration of national unity. “From this moment forward, we work together, as a team, to lead Israel toward repair,” he told the crowd, who chanted “history,” as if it were being made.