Israel and the militant group Hezbollah have agreed to halt Israel’s invasion of Lebanon and Hezbollah’s attacks on northern Israel for 60 days — after a week of intensive deliberations aimed at stopping Lebanon’s deadliest war in decades.

Israeli Prime Minister Benjamin Netanyahu said that Israeli forces have severely weakened Hezbollah and that their focus is shifting back to fighting Hamas in the Gaza Strip. Lebanon’s caretaker prime minister, Najib Mikati, called the deal “a fundamental step towards establishing calm and stability in Lebanon,” during a phone call with President Joe Biden on Tuesday.

Since the start of the war in Gaza in October 2023, Hezbollah has routinely fired rockets into northern Israel. Israel launched a ground invasion into Lebanon in September, and divulged that it had carried out small cross-border raids earlier. The Israeli military has bombarded Beirut and other parts of Lebanon in what it says are attempts to destroy Hezbollah’s strongholds and weaponry.

Here’s what to know about the ceasefire deal, its terms and how it will be enforced.

What are the terms of the deal?

The ceasefire agreement went into effect at 4 a.m. local time Wednesday, with plans for Israeli soldiers to withdraw gradually and for the Lebanese army to increase its presence in Lebanon’s south.

All Israeli soldiers are expected to withdraw within the 60-day period. The idea is that Israel will withdraw as Lebanese forces take up their positions so as to “not to create a vacuum,” a senior Biden administration official said, briefing reporters on the condition of anonymity under rules set by the White House.

Lebanese forces are expected to take control of the area between the Israeli border and the Litani River, according to the official.

The official denied earlier reports that Israel and the United States had struck a separate agreement guaranteeing Israel’s unilateral right to again attack Lebanon if a threat is perceived and said negotiators did not discuss any military aid for Israel.

The ceasefire would be broken if Hezbollah fires at Israel or if Hezbollah acquires more weapons or tries to rebuild infrastructure such as tunnels or launching positions in southern Lebanon.

The duration of the ceasefire will depend on “what happens in Lebanon,” Netanyahu said Tuesday. “We maintain full freedom of military action,” he added, saying Israel would begin striking the militant group again if the deal is violated.

Will this end fighting between Israel and Hezbollah?

The ceasefire agreement is expected to stop the war for 60 days, but fighting continued up to the 11th hour before the agreement took effect.

Officials told The Washington Post that negotiators aim to work toward a longer-term solution during the ceasefire period.

“This is designed to be a permanent cessation of hostilities,” Biden said during a speech at the White House Rose Garden on Tuesday. “What is left of Hezbollah and other terrorist organizations will not be allowed … to threaten the security of Israel again.”

Why was a ceasefire reached now?

Tensions between Israel and Lebanon have flared in recent months, ratcheting up the stakes of the conflict and stoking fears of a widening war in the Middle East. The death toll has steadily risen on both sides.

For the Biden administration, the ceasefire deal comes as the inauguration of President-elect Donald Trump is fast approaching in January. In a speech Tuesday, Biden said he hopes to achieve a similar ceasefire in Gaza before leaving office. “Just as the Lebanese people deserve a future of security and prosperity, so do the people of Gaza. They, too, deserve an end to the fighting and displacement,” he said.

Biden also said the ceasefire creates an opportunity for a more sweeping, long-sought Middle East deal that he and his aides have discussed for years. That deal would normalize relations between Israel and Saudi Arabia, provide a pathway for a Palestinian state and include a security pact and economic guarantees that the United States would provide Riyadh.

“As for the broader Middle East region, today’s announcement brings us closer to realizing the affirmative agenda that I’ve been pushing forward during my entire presidency: a vision for the Middle East, with peace and prosperity integrated across borders,” Biden said. “The United States remains prepared to conclude a set of historic deals.”

Who will enforce the deal?

Lebanese forces are expected to ensure that all heavy weaponry and Hezbollah infrastructure has been removed as they take over the area between the Israeli border and the Litani River, and the United States and France will join an existing verification mission to ensure “that any violations are deterred,” a senior Biden administration official said, speaking on the condition of anonymity under rules set by the White House.

The U.N. Interim Force in Lebanon, or UNIFIL — a peacekeeping group made up of about 10,000 civilians and soldiers from 50 countries — is also expected to deploy to southern Lebanon to help enforce the agreement.

The mission will not involve any U.S. troops on Lebanese territory, but the United States will work with the Lebanese army to bolster its capacity and training, the official said.

— Bryan Pietsch and Ellen Francis contributed to this report.