WASHINGTON — Ten days before Donald J. Trump took office, Sheldon G. Adelson went to Trump Tower for a private meeting. Afterward, Mr. Adelson, the casino billionaire and Republican donor, called an old friend, Morton A. Klein, to report that Mr. Trump told him that moving the American Embassy from Tel Aviv to Jerusalem would be a major priority.
“He was very excited, as was I,” said Mr. Klein, the president of the Zionist Organization of America, a hard-line pro-Israel group. “This is something that’s in his heart and soul.”
The two men had to wait nearly a year, but on Wednesday, Mr. Trump stood beneath a portrait of George Washington to announce that he was formally recognizing Jerusalem as the capital of Israel and setting in motion a plan to move the embassy to the fiercely contested Holy City.
“While previous presidents have made this a major campaign promise,” he said, “they failed to deliver. Today, I am delivering.”
For Mr. Trump, the status of Jerusalem was always more a political imperative than a diplomatic dilemma. Faced with disappointing evangelical and pro-Israel backers like Mr. Adelson, or alarming allies and Arab leaders while jeopardizing his own peace initiative, the president sided with his key supporters.
In doing so, Mr. Trump invited opprobrium from foreign leaders, who said the move was reckless and self-defeating. He also acted against the counsel of Secretary of State Rex W. Tillerson and Defense Secretary Jim Mattis, who worried about anti-American blowback, not least to diplomats and troops serving overseas.
Mr. Trump conceded the provocative nature of his decision. But as he has before, whether in pulling the United States from the Paris climate accord or disavowing the Iran nuclear deal, the president on Wednesday seemed to relish playing a familiar role: the political insurgent, defying foreign policy orthodoxy on behalf of the people who elected him.
“People are waking up to the fact that the president doesn’t see grays and doesn’t like pastels,” said Christopher Ruddy, a conservative news media executive and friend of Mr. Trump’s. “He is very proud that he’s fulfilled so many campaign promises, and the embassy decision is another notch on his belt.”
Mr. Trump’s handling of the embassy question was not unlike his handling of the nuclear deal with Iran, which he reluctantly certified the first time before disavowing it the second time the issue came up.
Under a 1995 law, the president is required to move the embassy from Tel Aviv to Jerusalem unless, citing national security concerns, he signs a waiver, which has to be renewed every six months. The first time he faced that decision, in June, Mr. Trump grudgingly signed it.
At the time, his son-in-law, Jared Kushner, who is leading Mr. Trump’s peace initiative, argued that to move the embassy then might strangle the effort before the administration had established relationships in the region.
Mr. Adelson and other pro-Israel backers were deeply frustrated. He pressed Mr. Trump on the issue at a private dinner in October at the White House that included his wife, Miriam, and Mr. Kushner. Mr. Adelson also vented to Stephen K. Bannon, then the president’s chief strategist, who argued internally for moving the embassy in June.
The Adelsons have long been leading donors to pro-Israel groups and causes, and have forged a close relationship with Prime Minister Benjamin Netanyahu. They have used their casino fortune to push the Republican Party and its politicians to embrace that line.
Early in Mr. Trump’s campaign for the Republican presidential nomination, he privately courted the Adelsons, seeking a meeting and asking for financial support, even as he publicly declared that he did not need or want backing from major donors.
In March 2016, Mr. Trump sought to burnish his credentials as a friend of Israel, telling the American Israel Public Affairs Committee, the most powerful pro-Israel lobbying group, “We will move the American embassy to the eternal capital of the Jewish people, Jerusalem.”
The Adelsons were persuaded and donated $ 20 million to a political action committee that supported Mr. Trump’s campaign, and another $ 1.5 million to the committee that organized the Republican convention.
Since Mr. Trump took office, Mr. Adelson has communicated with him regularly, talking by phone and visiting the White House, and has used his access to push the relocation of the embassy. But he was not the only influential advocate of the move.
Representatives of evangelical Christian groups similarly pressed the issue with Mr. Trump during the campaign, making it clear that moving the embassy was a major priority.
“In the meetings I was in, it was clearly communicated that evangelicals and Bible-believing Christians see a special relationship with Israel,” said Tony Perkins, the president of the Family Research Council.
When the six-month clock expired again this month, Mr. Trump was determined to leave himself more options. On Nov. 27, he walked into a meeting of the principals’ committee of the National Security Council, as the officials were debating what to do about the embassy. His message, according to officials, was that he wanted more creative solutions.
Mr. Trump’s advisers offered him two alternatives: Sign the waiver again, or sign it but recognize Jerusalem as the capital and set in motion a plan to move the embassy. Mr. Trump mulled the decision for several days, officials said, calling foreign leaders and lawmakers on Capitol Hill. And on Wednesday he announced he was taking the more aggressive approach, again signing the waiver but making it clear he would proceed with a move.
His decision was supported by both Mr. Kushner and the president’s special envoy, Jason D. Greenblatt, who had concluded that shaking up the status quo could actually help rather than hurt their peace efforts.
While they say they recognized that it would cause an immediate uproar — including potentially driving the Palestinians away from negotiations for some time — they believed the process was resilient enough to withstand the shock.
Publicly, Mr. Tillerson has stood by the decision, while Mr. Mattis has been circumspect. Speaking to reporters on Tuesday, Mr. Mattis said: “We met in the room on this. It was an open discussion, went on for some time. As always, my advice to the president, I keep confidential.”
A senior adviser to Mr. Tillerson, R. C. Hammond, told reporters that he did not oppose the move, but requested more time, when Mr. Trump’s decision was clear, to contact American diplomatic missions to determine their security needs if protests broke out.
Amid all the warnings about violence, White House officials see a number of potential benefits to the move. Recognizing Jerusalem, officials said, could soothe the right flank of Mr. Netanyahu’s coalition government, stabilizing the political situation there.
Also, the Saudi royal family has sharply criticized Mr. Trump’s decision, which some officials said could help the credibility of Crown Prince Mohammed bin Salman among his fellow Arabs. That could mitigate perceptions that the crown prince has grown too cozy with Mr. Kushner, with whom he has cultivated a close relationship.
In his remarks at the White House, Mr. Trump did not dwell on how his decision might play out in the region. Rather, he cast it as a bold break with decades of failed policy on Jerusalem, which he said brought us “no closer to a lasting peace agreement between Israel and the Palestinians.”
“It would be folly to assume that repeating the exact same formula would now produce a different or better result,” Mr. Trump said.
Though he did not mention it, Mr. Trump signed the same waiver as his predecessors, Presidents Bill Clinton, George W. Bush and Barack Obama, to keep the embassy in Tel Aviv for now. White House officials said that was unavoidable because it would take several years to move embassy employees to a new building in Jerusalem.
In his speech, Mr. Trump pointed out that the 1995 law passed Congress with an overwhelming majority and was unanimously reaffirmed in the Senate six months ago. That may explain why the reaction to the move was comparatively muted on Capitol Hill.
For Mr. Trump, the political benefits clearly outweigh the costs. The Republican Jewish Committee bought a full-page ad in The New York Times that is to be published on Thursday, depicting Mr. Trump praying at the Western Wall.
“President Trump,” the slogan said, “You Promised. You Delivered.”
To press its case with supporters, the White House convened two calls for religious leaders, one on Tuesday night to alert them to the coming announcement and a second, more detailed call on Wednesday.
Most of the participants were from the evangelical Christian community and included Trump allies like Ralph Reed, the founder of the Faith and Freedom Coalition; Robert Jeffress, a Dallas pastor who spoke at Mr. Trump’s private inaugural prayer service; and Mike Evans, a Christian Zionist who writes commentary on Middle Eastern issues.
Among the questions they asked was how quickly the president would move the embassy. White House officials pleaded for patience. At the end of the call, according to a person who took part, a pastor and a rabbi closed with prayers.
“Pray for the peace of Jerusalem,” the pastor said. “And thank God we have a president who would take this step.”