JIDDA, Saudi Arabia — King Abdullah of Saudi Arabia assured American officials on Friday that he would use his influence with Sunni leaders in Iraq to try to speed the formation of a multisect government there, a senior State Department official said.

The king’s assurance is a shift in the Sunni monarchy’s stance and was conveyed to Secretary of State John Kerry in a meeting that lasted three and a half hours here.

The Saudis had been reluctant to support the formation of a new Iraqi government until it became clear that Prime Minister Nuri Kamal al-Maliki would not be given a third term.

The failing security situation in Iraq, which has brought militants from the Islamic State in Iraq and Syria to within striking distance of the Saudi border in western Iraq, appeared to have led to a change in Saudi calculations.