CHARLOTTE, N.C. (AP) — Needled by Mitt Romney and other Republicans, Democrats hurriedly rewrote their convention platform Wednesday to add a mention of God and declare Jerusalem the capital of Israel after President Barack Obama intervened to order the changes.

The embarrassing reversal was compounded by chaos and uncertainty on the convention floor. Three times Los Angeles Mayor Antonio Villaraigosa, the convention chairman, called for a voice vote on the changes and each time the yes and no votes seemed to balance each other out. On the third attempt, Villaraigosa ruled the amendments were approved — triggering boos from many in the audience.

The episode exposed tensions on Israel within the party, put Democrats on the defensive and created a public relations spectacle as Obama arrived in the convention city to claim his party's nomination for a second term.

"There was no discussion. We didn't even see it coming. We were blindsided by it," said Noor Ul-Hasan, a Muslim delegate from Salt Lake City, who questioned whether the convention had enough of a quorum to even amend the platform.

"The majority spoke last night," said Angela Urrea, a delegate from Roy, Utah. "We shouldn't be declaring Jerusalem as the capital of Israel."

The language in the platform — a political document — does not affect actual U.S. policy toward Israel. The administration has long said that determining Jerusalem's status is an issue that should be decided in peace talks by Israelis and Palestinians.

The American Israel Public Affairs Committee, the powerful pro-Israel lobbying group, welcomed the support of Democrats and Republicans alike on Israel. "Together, these party platforms reflect strong bipartisan support for the US-Israel relationship," AIPAC said.

Obama intervened directly to get the language changed both on Jerusalem and to reinstate God in the platform, according to campaign officials who insisted on anonymity to describe behind-the-scenes party negotiations. They said Obama's reaction to the omission of God from the platform was to wonder why it was removed in the first place.

Rep. Debbie Wasserman Schultz, D-Fla., the party chairman, said both the God and Jerusalem omissions were "essentially a technical oversight." She insisted in a CNN interview there had been no discord on the floor and said the vote definitely met the two-thirds threshold.

The revisions came as Obama struggles to win support from white working-class voters, many of whom have strong religious beliefs, and as Republicans try to woo Jewish voters and contributors away from the Democratic Party. Republicans claimed the platform omissions suggested Obama was weak in his defense of Israel and out of touch with mainstream Americans.

GOP officials argued that not taking a position on Jerusalem's status in the party platform raised questions about Obama's support for the Mideast ally. Romney said omitting God "suggests a party that is increasingly out of touch with the mainstream of the American people."

"I think this party is veering further and further away into an extreme wing that Americans don't recognize," Romney said.

Added to the Democratic platform was a declaration that Jerusalem "is and will remain the capital of Israel. The parties have agreed that Jerusalem is a matter for final status negotiations. It should remain an undivided city accessible to people of all faiths."

That language was included in the platform four years ago when Obama ran for his first term, but was left out when Democrats on Tuesday approved their 2012 platform, which referred only to the nation's "unshakable commitment to Israel's security."

Also restored from the 2008 platform was language calling for a government that "gives everyone willing to work hard the chance to make the most of their God-given potential."

For decades, Republican and Democratic administrations alike have said it is up to the Israelis and Palestinians to settle Jerusalem's final status — a position reiterated earlier Wednesday by the White House. Both sides claim Jerusalem as their capital, and the city's status has long been among the thorniest issues in Mideast peace talks.

The U.S. has its embassy in Tel Aviv, although numerous Republicans — including Mitt Romney — have vowed to move the embassy to Jerusalem.

During his 2008 campaign, Obama referred to Jerusalem as Israel's capital in a speech to AIPAC. But as official policy, his administration has repeatedly maintained that Jerusalem's status is an issue that Israelis and Palestinians should decide in peace talks. The platform flub gave Republicans an opening to revive their attacks on Obama's support for Israel just as Democrats were hoping to bask in the glow of first lady Michelle Obama's Tuesday speech and gin up excitement for her husband, who will accept his party's nomination for a second term on Thursday.

But restoring the language did not placate Republicans, who used it to suggest that Obama's party is now more supportive than he is of the Jewish state.

"Now is the time for President Obama to state in unequivocal terms whether or not he believes Jerusalem is Israel's capital," said Romney spokeswoman Andrea Saul.

Republicans declared Jerusalem the capital of Israel in the platform the party approved last week at its convention in Tampa, Fla. GOP platforms in 2004 and 2008 also called Jerusalem the capital.