JERUSALEM — Israeli Prime Minister Benjamin Netanyahu appointed a former rival, Gideon Saar, as a member of his cabinet on Sunday, expanding his coalition and strengthening his hold on office.

Under their agreement, Netanyahu said Saar would serve as a minister without portfolio and serve in the security cabinet, the body that oversees the management of the ongoing war against Israel’s enemies across the Middle East.

Saar, 57, had hoped to replace Defence Minister Yoav Gallant, another rival of Netanyahu’s. But a deal to become defence minister fell through several weeks ago after fighting intensified with Hezbollah along Israel’s northern border, leaving the popular Gallant in office for the time being.

Saar has had a strained relationship with the prime minister. He was once a rising star in Netanyahu’s Likud party, but angrily left it four years ago after accusing the prime minister of turning it into a “cult of personality” as he battled corruption charges.

Since then, however, Saar has struggled as leader of a small conservative party, enjoying little support with the broader public. While he and Netanyahu have little love for one another, they share a hardline ideology toward Israel’s Arab adversaries.

In recent months, Saar has said Israel must fight until Hamas is destroyed. He also has called for tougher action against Hezbollah’s sponsor, Iran. And like Netanyahu, he strongly opposes the establishment of a Palestinian state.

In a joint statement, they said they had put their differences aside for the good of the nation.

RECOMMENDED VIDEO

Netanyahu’s decision appears to have been driven in part by domestic politics. He faces a number of key political battles in the coming weeks — including the contentious issue of drafting ultra-Orthodox men into the army, passing a budget and taking the stand in his long-running corruption trial. Saar is expected to help Netanyahu on many of these issues.

His appointment also will likely scale back the influence of ultranationalist members of his coalition. Bezalel Smotrich, the Israeli finance minister, and Itamar Ben-Gvir, Israel’s minister of national security, are religious ideologues who have threatened to bring down the government if Netanyahu makes too many concessions in any ceasefire deal. Ben-Gvir has also drawn international criticism for provocative visits to a contested Jerusalem holy site.

Sunday’s agreement gives Saar, who hopes to be prime minister one day, an opportunity to revive his political career, while expanding Netanyahu’s majority coalition to 68 seats in the 120-seat parliament.