Ban expressed his deepest sympathy and condolences to the families of the victims.
"The secretary-general condemns the terrorist attack in Berlin last night," said a statement from his spokesman.
He "hopes anyone involved in the commission of this appalling crime will be swiftly brought to justice," he added.