The largest U.S. Presbyterian church narrowly voted Friday to divest from three multinational corporations that it said supply Israel with products that promote violence in occupied Palestinian territories.

The divestment, vehemently opposed by many of the nation's prominent Jewish organizations, and hailed by many pro-Palestinian activists, passed by seven votes after hours of tense and complex debate. It means the Presbyterian Church (USA) will sell its shares of Motorola Solutions, Caterpillar and Hewlett Packard, worth about $21 million.

The vote at the church's biennial General Assembly, meeting this week in Detroit, was 310 to 303. It makes the 1.76-million member church the largest religious group to vote for divestment, an issue that has been fiercely debated in recent years among mainline Protestants. The Episcopal Church and Evangelical Lutheran Church in America both have rejected divestment. Presbyterians have discussed divestment for a decade, and a similar vote was defeated by a slim margin two years ago at the last church assembly.

There was an audible gasp on the floor of the COBO Center in downtown Detroit after the motion passed. "In no way is this a reflection of our lack of love for our Jewish brothers and sisters," Heath Rada, the church assembly's moderator, told the assembly afterwards.

But opponents described it as exactly that.

"This decision will undoubtedly have a devastating impact on relations between mainstream Jewish groups and the national Presbyterian Church (USA)," said Rabbi Steve Gutow, president of the Jewish Council for Public Affairs, whose organization was one of several major Jewish groups that had flown rabbis to Detroit to plead against divestment. Gutow, in a statement, described the vote as stemming from a "deep animus" in church leadership against "both the Jewish people and the State of Israel."

Supporters of the wider Boycott, Divestment and Sanctions movement, or BDS, described Presbyterian divestment as a victory, though the measure the church passed Friday evening separated itself from the movement.

Divesting from the three companies is "not to be construed or represented by any organization of the PC(USA) as divestment from the State of Israel, or an alignment with or endorsement of the global BDS (Boycott, Divest and Sanctions) movement," said the text of the Presbyterian's overture.

The vote, amended several times on the assembly floor, also supported interfaith cooperation, the right of Israel to exist, and a two-state solution. In addition, it said the church should strive for "positive investment" in nonviolent efforts that help everyday Israelis and Palestinians. An effort supporting "positive investment" was passed at the church assembly in 2012, and the church has since invested close to a $1 million in education, renewable energy and microfinance in the Palestinian territories, according to Elizabeth Dunning, moderator of the church Mission Responsibility Through Investment committee.

Dunning said the church singled out Caterpillar because its bulldozers have been used to demolish Palestinian homes. Motorola Solutions, she said, was selected because the Israeli Defense Force buys the company's communication technologies. She said the church targeted Hewlett-Packard because the Israeli Navy has used its products to coordinate the blockade of the Gaza Strip and because its biometric scanners are in place at checkpoints.

In a prior interviews and statements, Motorola and Hewlett-Packard representatives have defended their products and cited their safety and human rights protection measures. A Motorola Solutions spokeswoman said the company's checkpoint equipment helps "people to get to their place of work or to carry out their business in a faster and safer way." Caterpillar has said it doesn't sell its equipment directly to Israel, but to the U.S. government.

Pro-divestment speakers at the convention on Friday said the church has tried over the years to discuss its concerns with the companies, to no avail.

"These companies have failed to modify their behavior and continue to profit from Israeli human rights abuses and non-peaceful pursuits," said the Rev. Walt Davis, a professor emeritus of San Francisco Theological Seminary and member of the Israel/Palestine Mission Network.

The network, a strong divestment supporter made up of Presbyterians, came under intense criticism this week by Jewish and pro-Israel activists, who had attacked not only its position on divestment, but also "Zionism Unsettled," a booklet it published that was sold in the church's online store. It called Zionism a "false theology."

More than 1,700 rabbis signed a letter to the church asking it to oppose divestment and criticizing it for selling the network's literature. Major Jewish groups, including the Union for Reform Judaism and the Anti-Defamation League, came out against the pamphlet and divestment. Abraham H. Foxman, ADL national director, said Friday that church leaders have "fomented an atmosphere of open hostility to Israel" and that the vote sent a "painful message" about Jewish-Presbyterian relations.

Rabbi Rick Jacobs, the president of the Union for Reform Judaism, twice addressed Presbyterians on the assembly floor to plead against divesting -- including offering to set up a meeting for church leaders with Israeli Prime Minister Benjamin Netanyahu if they voted it down. He said the church was not only choosing divestment, but "separation" from Israel and Jewish allies. "So be it," he added.

In one move that did align with pro-Israel groups' goals, but was largely overshadowed by divestment, the church voted down a proposal to boycott all Hewlett-Packard products.

The church is not the first religious group to divest, though it's the biggest and most influential. The Friends Fiduciary Corp., which coordinates investments for 250 Quaker groups, divested from Caterpillar, Motorola Solutions and Veolia Environment in 2012. Last year, the Mennonite Central Committee decided to not "knowingly invest in companies that benefit from products or services used to perpetrate acts of violence against Palestinians [and] Israelis." Although the United Methodists voted against churchwide divestment in 2012, its General Board of Pension and Health Benefits decided last week to sell its stock in G4S, a prison and security services company, after members asked questions about its work in Israel and the Palestinian territories.

Not all Jews came out against the Presbyterian vote. Jewish Voice for Peace, a pro-divestment group based in Oakland, California, and Washington, D.C., sent several rabbis, many of the Reconstructionist denomination, to lobby in Detroit.