Ban demanded that Morsi and his high-level backers "be released or have their cases reviewed transparently without delay," said deputy UN spokesman Eduardo del Buey.
Morsi and several Muslim Brotherhood leaders have been detained since the military drove him from power on July 3 in response to massive protests calling for his ouster.
Taking a step back after outraging Islamists and sparking concern in Washington, the military insisted on Thursday that it was not targeting Morsi's backers in calling for a mass rally to counter "terrorism and violence."
Police said they were planning large-scale reinforcements to secure Friday's rallies, amid fears they could turn into a massive showdown between Islamists demanding Morsi's reinstatement and an array of opponents, including the military.
Egypt's military has set a 48-hour deadline, which expires late on Friday, after which it will decisively deal with "violence and terrorism," according to a statement posted on a military-linked Facebook account.
Military chief Abdel Fattah al-Sisi had issued the deadline, it said, at the end of which, "the strategy for dealing with violence and terrorism will change... appropriately to deal guarantee security and stability."
A senior army official told AFP the statement did not reflect the military's point of view, although it appeared on a "page with links to the armed forces."
"The 48-hour ultimatum is a political invitation," the officer said. "It doesn't mean after 48 hours we are going to crack down."
Hisham Qandil, prime minister before Morsi was pushed aside by the army on July 3, on Thursday proposed a three-stage roadmap that would start with confidence-building steps.
In a video recording posted on YouTube, the former premier said both sides should refrain from marches and hold rallies only in fixed locations.
Qandil was among the representatives of Morsi's camp in a meeting with EU diplomat Catherine Ashton last week.
He also called for the release of prisoners detained in the days leading up to Morsi's ouster by the military, and those detained since.
A delegation should be allowed to visit Morsi, detained by the army since his overthrow, to check on his health, he added.
Earlier Thursday, the fugitive leader of the Muslim Brotherhood, Mohamed Badie, urged Egyptians to peacefully make a "stand for freedom and legitimacy, and against the bloody coup".
The United States on Wednesday expressed its concern at Sisi's call. After his comments, Washington, which has close ties with Egypt's military, announced it would suspend a delivery of F-16 warplanes.
In its statement Thursday, the military said Sisi's "call was not a threat to any political group in particular."
Army-installed interim president Adly Mansour's spokesman, who had supported Sisi's call, on Thursday called for peaceful rallies and cautioned against vigilantism.
The Brotherhood and allied Islamist groups had denounced Sisi's call as "an announcement of civil war".
Senior Brotherhood leader Essam al-Erian said Morsi loyalists would not be intimidated by the army chief's call for mass rallies. "Your threat will not prevent millions from continuously protesting," Erian wrote on Facebook.
London-based rights group Amnesty International also criticised the decision in a statement on Thursday.
"Given the security forces' routine use of excessive force, such a move is likely to lead to yet more unlawful killings," said Hassiba Hadj Sahraoui, Amnesty's deputy director of its Middle East and North Africa programme.
Egyptian newspapers, mostly hostile to the Brotherhood, gave front-page coverage to Sisi's call, made in a Wednesday speech.
In Qatar, a Muslim organisation headed by the influential Egyptian-born cleric Yusuf al-Qaradawi issued an edict against obeying Sisi's call.
The general's unusual demand -- the military insists he is merely a defence minister and deputy premier in the army-installed cabinet -- came after calls for a crackdown on Islamists staging sometimes bloody protests since the July coup.
"Next Friday, all honourable Egyptians must take to the street to give me a mandate and command to end terrorism and violence," the general said, wearing dark sunglasses as he addressed a military graduation ceremony near the Mediterranean city of Alexandria.
Tamarod, the movement that spearheaded the mass anti-Morsi rallies that led up to the coup, called on supporters to take to the streets again on Friday to support the army.
In the latest violence, two soldiers were shot dead on Thursday in the restive Sinai peninsula, where militants have staged daily attacks on security forces.
Almost 200 people have died in political unrest since the end of June, according to an AFP tally, many of them in clashes between Morsi's supporters and opponents and in militants' attacks in the Sinai.