JERUSALEM — Hundreds of hunger-striking Palestinian prisoners ended their 40-day fast on the first day of the month-long Muslim holiday of Ramadan, after reaching a compromise with Israel for additional family visits, Israeli and Palestinian officials said. More than 6,000 Palestinians are currently in prison for offenses linked to the Israeli-Palestinian conflict, for charges ranging from stone-throwing to weapons possession and attacks that killed or wounded Israeli civilians and soldiers. Palestinians rallied behind the hunger strikers as national heroes, relishing a rare break from deep divisions between two rival political groups — the Islamic militant group Hamas, which runs Gaza, and Fatah, the movement of Western-backed Palestinian President Mahmoud Abbas that administers autonomous enclaves in the Israeli-occupied West Bank. Israel’s public security minister, Gilad Erdan, alleged the hunger strike was motivated by a power struggle in Abbas’ Fatah movement.