DETROIT — After passionate debate over how best to help break the deadlock between Israel and the Palestinians, the Presbyterian Church (U.S.A.) voted on Friday at its general convention to divest from three companies that it says supply Israel with equipment used in the occupation of Palestinian territory.

The vote, by a count of 310 to 303, was watched closely in Washington and Jerusalem and by Palestinians as a sign of momentum for a movement to pressure Israel to stop building settlements in the West Bank and East Jerusalem and to end the occupation, with a campaign known as B.D.S., for Boycott, Divestment and Sanctions.

The Presbyterian Church (U.S.A.), one of a handful of historic mainline Protestant denominations and the church of many American presidents, is the largest yet to endorse divestment at a churchwide convention, and the vote follows a decade of debate — and a close call at the assembly two years ago, when divestment failed by only two votes.

The measure that was passed not only called for divestment but also reaffirmed Israel’s right to exist, endorsed a two-state solution, encouraged interfaith dialogue and travel to the Holy Land, and instructed the church to undertake “positive investment” in endeavors that advance peace and improve the lives of Israelis and Palestinians. It also said the motion was “not to be construed” as “alignment with or endorsement of the global B.D.S.” movement by the Presbyterian Church (U.S.A.). The language was written by the church’s 65-member Middle East committee.