BAGHDAD — The Iraqi government said Sunday that Sunni militants had taken control of a major Iraqi post on the Syrian border, strengthening their ability to move men and supplies into Iraq’s heartland.

As the government tried to cast the setback in a positive light, saying troops had made a “tactical” decision to withdraw, Secretary of State John Kerry appeared to increase the pressure on Iraq’s leadership by signaling that the United States was open to the selection of a new prime minister who could bridge the deep sectarian divides in the country.

“The United States would like to see the Iraqi people find leadership that is prepared to represent all of the people of Iraq,” Mr. Kerry said Sunday in Cairo, at the start of a Middle East trip to rally Arab support on the Iraq crisis.

The formal American position, which Mr. Kerry underscored at a news conference with Egypt’s foreign minister, is that the United States is not in the business of picking Iraq’s leaders. But without mentioning Prime Minister Nuri Kamal al-Maliki by name, Mr. Kerry noted that the Kurds, the Sunnis and some Shiites had registered unhappiness with Iraq’s leadership, as has Ayatollah Ali al-Sistani, the influential Shiite spiritual leader who has spoken out about the need to avoid the mistakes of the past.