"I'm deeply concerned about the rapidly deteriorating security situation in Iraq, including the reports of mass summary executions by the Islamic State of Iraq and the Levant (ISIL)," Ban told reporters.
"There is a real risk of further sectarian violence on a massive scale within Iraq and beyond its borders," he said.
The ISIL militants, rooted in Iraq's Sunni Muslim community, are battling the Shiite-run central government that has ruled since dictator Saddam Hussein was ousted by a US-led coalition in 2003.
The militants, who have found favour among Sunni former Saddam supporters, have taken control of one province and parts of three others north of Baghdad since they began their assault last week.
They are said to have killed scores of captured Iraqi soldiers, as well as targetting civilians and abducting dozens of Turkish diplomats.
"I strongly condemn all these terrorist attacks, killing the civilian population and kidnapping diplomatic officials," said Ban.
"Those are unacceptable human rights violations," he said.
"All perpetrators of these gross violations of human rights should be brought to justice."
Washington has been mulling airstrikes, and has acknowledged that it shares an interest in stopping the militants with arch-rival and Shiite power Iran.
Ban refused to be drawn on potential international intervention.
"I know that many concerned countries are considering their own options how to help the Iraqi government," he said, noting that he had held talks with Iran and Turkey, among others.
The crisis has strained the already-complex ties between Iraq's three main communities — Shiite and Sunni Arabs, and Kurds.
The leaders of all sides should ensure their followers avoid reprisals, Ban said.
In addition, he said that like other crisis zones, Iraq needs to rethink how it is governed in order to stem community tensions in the first place.
"The large part of this problems comes from when the leaders are elected or given this mandate, they take it for granted," he said.
While being elected was crucial for democracy, "legitimacy comes from election as well as good governance and respecting human rights and reaching out to all the people" the UN chief said.
"When some of these elements are lacking, then it is only natural that people have concerns," he said.
"And then this kind of political instability leads to a breeding ground of extremism and terrorism."