The Supreme Court struck down as unconstitutional Monday a congressional attempt to allow Americans born in the contested city of Jerusalem to list Israel as their birthplace on passports, affirming the principle that the president alone has the power to recognize foreign nations.

The divided court treaded carefully in dealing with the “delicate subject” that is Jerusalem’s sovereignty, as well as previously unsettled disputes between presidents and Congress about the conduct of foreign policy.

But a majority of the court came down decisively on the side of the executive branch when the question is the recognition of foreign countries and their territorial boundaries.

“Put simply, the nation must have a single policy regarding which governments are legitimate in the eyes of the United States and which are not,” wrote Justice Anthony M. Kennedy. And if the nation must speak with one voice, “that voice must be the President’s.”

Every president since President Harry S. Truman has declared that the recognition of Israel as a close and trusted ally does not include an agreement about the disputed sovereignty of Jerusalem. Both Israelis and Arabs assert claims on the city, and the United States has said neutrality on its part is essential in trying to broker a lasting peace in the area.

The divided court treaded carefully in dealing with the “delicate subject” that is Jerusalem’s sovereignty. (Pablo Martinez Monsivais/AP)

The court was considering an attempt by Congress in 2002 to allow Americans born in Jerusalem to list Israel as a birthplace on U.S. passports if that is what the parents want. President George W. Bush said he would not allow the State Department to honor the request, and President Obama has continued the practice.

The vote to strike down the law was 6 to 3, with the court’s four liberals — Justices Ruth Bader Ginsburg, Stephen G. Breyer, Sonia Sotomayor and Elena Kagan — joining Kennedy’s opinion. Justice Clarence Thomas said the law was unconstitutional, but he did not endorse Kennedy’s reasoning.

Chief Justice John G. Roberts Jr. said the court had ventured into unmarked and treacherous territory.

“The court takes the perilous step — for the first time in our history — of allowing the president to defy an act of Congress in the field of foreign affairs,” he wrote in a dissent that was joined by Justice Samuel A. Alito Jr.

He said the majority was wrong that Congress was forcing the president’s hand on recognition simply by allowing the passport change. He said the decision was “based on the mere possibility that observers overseas might misperceive the significance of the birthplace designation.”

Justice Antonin Scalia also disagreed with the ruling, and he made his displeasure more pronounced by reading portions of his dissent from the bench.

“The text and structure of the Constitution divide responsibility for foreign policy, like responsibility for just about everything else, between the two coordinate, equal political branches,” Scalia said. “A principle that the nation must have a single foreign policy, which elevates efficiency above the text and structure of the Constitution, will systematically favor the president at the expense of Congress.”

The case was brought by Menachem Binyamin Zivotofsky, a boy born in 2002 who made his second trip to the Supreme Court to present the justices with a major separation-of-powers case.

There are about 50,000 people like Zivotofsky, whose passport lists the birthplace only as Jerusalem, and some of them want the option Congress passed in 2002.

The court’s ruling comes amid strained relations between the Obama administration and the government of Israeli Prime Minister Benjamin Netanyahu. Even though U.S. military and intelligence cooperation with Israel is stronger than ever, the personal relationship between the two leaders has grown increasingly ragged.

Netanyahu has urged Congress to oppose the U.S.-led nuclear negotiations with Iran. And Obama expressed his consternation at the end of Israeli elections when Netanyahu said Arab Israelis were voting in “droves” and declared there would be no independent Palestinian state on his watch, a vow he has since backed away from.

Both Israel and the Palestinian national movement claim Jerusalem as their capital. But the city was divided in 1949 following the war that broke out after Israel declared its independence.

Israel has controlled western Jerusalem since then, and it occupied East Jerusalem nearly two decades later during the 1967 Arab-Israeli War. Israel later annexed the eastern part of the city, although neither the United States nor the United Nations recognizes the move. The U.S. government’s position has long been that Jerusalem’s status must be resolved as part of Israeli-Palestinian peace negotiations, which are now dormant.

Reaction from those who had supported the option offered by Congress was predictable.

Abraham H. Foxman, national director of the Anti-Defamation League, said the “simple and ministerial act” of listing Israel as the birthplace of those born in Jerusalem did not require “a sweeping decision about executive power.”

“However, now that the court has issued a ruling emphasizing the role of the executive in setting foreign policy, it is time for this administration to step up,” he said. “How long will the U.S. government continue to have this hypocritical and myopic approach?”

Kennedy went to lengths to acknowledge the role that Congress has to play in foreign policy. And he noted that despite the importance of the recognition power, the word itself is not used in the Constitution. Instead, the document says that the president “shall receive Ambassadors and other public Ministers.”

But he said that scholars acknowledge that as “tantamount to recognizing the sovereignty of the sending state.”

And while Kennedy said the administration was asking for too much in declaring that the president has “exclusive authority to conduct diplomatic relations,” he said history and precedent make clear that the executive takes the lead in certain areas.

The dueling opinions — in all, five of the nine justices wrote in a case that has taken seven months to decide — featured a rare spat between Thomas and Scalia.

In finding against the law, Thomas based his decision on an interpretation that “the President has residual foreign affairs authority to regulate passports” with which Congress may not tamper.

Scalia groused that Thomas’s reading of executive power produces “a presidency more reminiscent of George III than George Washington.”

But Thomas countered that Scalia’s view of the “Constitution’s resolution of conflict among the branches” could itself be criticized as “creating a supreme legislative body more reminiscent of the Parliament in England than the Congress in America.”

When the case got to the Supreme Court three years ago, the issue was whether the judiciary could even settle the dispute or whether it was a “political question” that the executive and legislative branches must hash out.

The court ruled 8 to 1 that the judiciary should settle the matter and sent it back to lower courts. An appeals court ruled for the administration, and Monday’s decision affirmed that ruling.

The case is Zivotofsky v. Kerry.

Carol Morello contributed to this report.

Read more on the Supreme Court:

Public to Supreme Court: Don’t gut Obamacare

Supreme Court refuses to take up challenge to San Francisco gun law

Supreme Court allows suit by Muslim woman who says headscarf cost her a job