Currently, eight countries maintain consulates-general in Jerusalem: Belgium, France, Greece, Italy, Spain, Sweden, Turkey, and the United Kingdom.
Under the United Nations Partition Plan of 1947, Jerusalem was to become a corpus separatum under international control, separate from both the Jewish state and the Arab one whose creation the partition plan envisaged; that would have logically entailed various countries having a separate diplomatic representation in Jerusalem.
Thus, the anomalous Jerusalem consulates serve as a convenient way for various countries to have a diplomatic presence in the city without recognizing such Israeli "accomplished facts".
The United States maintained a consulate general in Jerusalem between 1844 and 2019, which was also responsible for conducting relations with Palestinians.
[1][5] All countries with consulates-general in Jerusalem include the contacts with the Palestinian National Authority in the consulate-general's responsibilities.