Mr Ban urged the south to withdraw its forces immediately to stop border clashes spiralling into a war.
South Sudan has issued a statement to say it is not interested in war with its northern neighbour. It says Heglig is rightfully part of South Sudan and it does not want the north to use it as a base for attacks.
But Mr Ban said the seizure of Heglig "is an infringement on the sovereignty of Sudan and a clearly illegal act".
South Sudan says it will only withdraw from Heglig if the UN deploys monitors there. In Sudan, President Omar al-Bashir continued his verbal attacks threatening to teach the south a "final lesson". On Wednesday he had threatened to bring its government down.
The Arab League has scheduled an emergency meeting in Cairo next week to deal with the crisis.