LONDON — Emboldened by President Trump’s recognition of Jerusalem as Israel’s capital, Benjamin Netanyahu paid the first visit to the European Union headquarters by an Israeli prime minister in 22 years on Monday, to seek similar endorsement from the 28-nation bloc.

The answer, though, was clear: no.

The bloc’s members are not unified in their attitudes toward Israel, but the European Union’s official position is that it supports what Federica Mogherini, its foreign policy chief, called the “international consensus” from which Mr. Trump departed last week when he announced a reversal of decades of American diplomacy.

The European Union, she said, remains committed to a two-state settlement for the Israelis and the Palestinians, with “Jerusalem as the capital of both.” The bloc is the biggest provider of aid to the Palestinians.

Both Mr. Netanyahu and European officials referred to White House plans to begin a new effort for peace in the Middle East that is being led by Trump advisers, including his son-in-law, Jared Kushner. The Israeli leader also expressed optimism that other countries would follow the American move on Jerusalem.