ERBIL, Iraq — The American Embassy in Baghdad plans to evacuate a substantial number of its personnel this week in the face of a militant advance that rapidly swept from the north toward the capital, the State Department announced on Sunday.

The embassy, a beige fortress on the banks of the Tigris River within the heavily secured Green Zone, where Iraqi government buildings are also situated, has the largest staff of any United States Embassy.

The exact number of people being evacuated from Baghdad — the American government prefers to say they are being “relocated” — was not disclosed. But the embassy will remain open, and most of its staff will remain, according to the State Department.

The United States has a staff of about 5,500 at the embassy and at two consulates in the north and south of Iraq.