Islamic State has captured wide swathes of northern Iraq since June, executing non-Sunni Muslim captives, displacing tens of thousands of people and drawing the first U.S. air strikes in the region since Washington withdrew troops in 2011.
After routing Kurdish forces this week, the militants are just 30 minutes' drive from Arbil, the Iraqi Kurdish capital, which up to now has been spared the sectarian bloodshed that has scarred other parts of Iraq for a decade.
The U.S. president said Washington would continue to provide military assistance and advice to Baghdad and Kurdish forces, but stressed repeatedly the importance of Iraq, which is a major oil exporter, forming its own inclusive government.
Read MoreUS bombs Iraq as Obama calls to prevent 'genocide'
Maliki has been widely criticized for authoritarian and sectarian policies that have alienated Sunnis and prompted some to support the insurgency.
"I think this a wake-up call for a lot of Iraqis inside of Baghdad recognizing that we're going to have to rethink how we do business if we're going to hold our country together," Obama said, before departing on a two-week vacation.
Employees of foreign oil firms have been leaving Arbil, and Kurds have snapped up AK-47 assault rifles in arms markets for fear of imminent attack, although these have proved ineffective against the superior firepower of the Islamic State fighters.
Given the Islamic State threat, a source in the Kurdistan Regional Government said it had received extra supplies of heavy weaponry from the Baghdad federal government "and other governments" in the past few days, but declined to elaborate.
In their latest advance through northern Iraq, the Islamic State seized a fifth oil field, several towns and Iraq's biggest dam, sending tens of thousands fleeing for their lives.
An engineer at the Mosul dam told Reuters that Islamic State fighters had brought in engineers to repair an emergency power line to the city, Iraq's biggest in the north, that had been cut off four days ago, causing power outages and water shortages.
"They are gathering people to work at the dam," he said.
A dam administrator said militants were putting up the trademark Islamic State black flags and patrolling with flatbed trucks mounted with machineguns to protect the facility they seized from Kurdish forces earlier this week.
The Islamic State, comprised mainly of Arabs and foreign fighters who want to reshape the map of the Middle East, pose the biggest threat to Iraq since Saddam Hussein was toppled by a U.S.-led invasion in 2003.
The Sunni militants, who have beheaded and crucified captives in their drive to eradicate unbelievers, first arrived in northern Iraq in June from Syria where they have captured wide tracts of territory in that country's civil war.
Almost unopposed by U.S.-trained Iraqi government forces who fled by the thousands, the insurgents swept through the region and have threatened to march on Baghdad with Iraqi military tanks, armoured personnel carriers and machineguns they seized.
The U.S. Defense Department said two F/A-18 warplanes from an aircraft carrier in the Gulf had dropped laser-guided 500-pound bombs on Islamic State artillery batteries. Other air strikes targeted mortar positions and an Islamic State convoy.
Obama has said this was needed to halt the Islamist advance, protect Americans in the region as well as hundreds of thousands of Christians and members of other religious minorities at risk.