His decision to fly back from Los Angeles came hours after the Security Council condemned attacks on protesters by Muamer Gaddafi's forces and demanded an immediate end to the violence in which hundreds have been killed.
The 15-nation council -- including Western powers, China, India and Russia -- also called for action against those responsible for the bloodshed, which has made Libya's the deadliest of a series of popular uprisings in the region.
"The current situation is unpredictable and could go in any number of directions, many of them dangerous," Ban said late Tuesday in a speech to a UN event in Los Angeles in which he announced he would return to New York.
"At this crucial juncture, it is imperative that the international community maintain its unity and act together to ensure a prompt and peaceful transition," he added, according to prepared remarks released by his office.
He reiterated that he had called for restraint in a 40-minute telephone call with Kadhafi on Monday that was "not an easy conversation."
"I told him, bluntly, that the violence must stop -- immediately," Ban said.
Libyan authorities have acknowledged at least 300 dead in the past week, but rights groups say the toll could be as high as 400.
Security Council members "underscored the need to hold to account those responsible for attacks, including by forces under their control, on civilians," said a statement released Tuesday after protracted negotiations.
It did not name Gaddafi, but made clear that the strongman who has ruled the North African nation for more than four decades was the target.
The Arab League had earlier suspended Libya, the first time it has taken such an action in response to a member state's internal affairs.
Libyan diplomats who have broken with Gaddafi had called on the Security Council to hold the meeting and requested a UN no-fly zone over the country as well as humanitarian action. But diplomats said these plans were not discussed.
B. Lynne Pascoe, the UN under-secretary-general for political affairs, told reporters after the meeting that UN staff and other witnesses in Libya had seen military activity.
"People have seen many planes overhead, they have seen helicopters overhead, they have seen tanks, they have seen some firing going on on the ground, they have seen some snipers," Pascoe said.
Ibrahim Dabbashi, the Libyan deputy ambassador, told reporters the council statement "was not strong enough" and said army units had launched fresh attacks after Kadhafi made an angry and defiant television speech.
He said renewed assaults were under way in Gharyan, Zuwarah and other cities and that a "genocide" had been launched against unarmed protesters.
UN special advisers on the prevention of genocide and protecting civilians, Francis Deng and Edward Luck, said in a statement that reports of "mass violence" coming out of Libya "may well constitute crimes against humanity."
Gaddafi ordered his forces to crush the uprising against his rule, warning armed protesters they would be executed and vowing to fight to the end.
The Arab world's longest-serving ruler said he would rather die as a martyr than give up power.
Western nations welcomed the Security Council statement as a strong first step against Gaddafi's crackdown.
But Philippe Bolopion, of Human Rights Watch, urged stronger action.
"At minimum, the Security Council should act now to impose a travel ban and an asset freeze on senior Libyan officials and military commanders found to be responsible for grave human rights violations," he said.