The company said it had reached an agreement with franchisee Alonyal for the return of 225 outlets across the country employing 5,000 people.
McDonald's was criticised after Alonyal started giving away thousands of free meals to Israeli soldiers.
Sales in the region have slumped since the conflict began in October.
On Thursday, McDonald's said a deal had been signed with Alonyal which has been running the chain of Golden Arches in Israel for more than 30 years.
The US company said the restaurants, operations and employees would be retained "on equivalent terms" and that it remained "committed to the Israeli market". Terms of the sale were not revealed.
The boycott was sparked after Muslim-majority countries such as Kuwait, Malaysia and Pakistan issued statements distancing themselves from the firm for its perceived support of Israel.
Vocal protests were staged world-wide as the grassroots boycott spread beyond the Middle East.
In January the global food chain admitted the conflict had "meaningfully impacted" its performance with business in France, Indonesia and Malaysia suffering, although its trade in the Middle East was worst affected.
Chief executive Chris Kempczinski blamed the backlash on "misinformation" but it hit the bottom line nonetheless and the company missed its first quarterly sales target in nearly four years.
The boycott was described as "disheartening and ill-founded" by McDonald's. The company relies on thousands of independent businesses to own and operate most of its more than 40,000 stores around the world. About 5% are located in the Middle East.
"In every country where we operate, including in Muslim countries, McDonald's is proudly represented by local owner operators," Mr Kempczinski said at the time.
"So long as this war is going on... we're not expecting to see any significant improvement [in these markets]," the McDonald's boss added.
The company will be hoping that by taking the Israeli business back "in house" it can restore its reputation in the Middle East and meet its key sales targets once more.
Much of the Gaza Strip has been devastated during the Israeli military operations that began after Hamas-led gunmen attacked southern Israel on 7 October, killing about 1,200 people and seizing 253 hostages.
About 130 of the hostages remain in captivity, at least 34 of whom are presumed dead.
More than 33,000 people have been killed in Gaza since then, the territory's Hamas-run health ministry says.
By Jemma Dempsey