Nimr al-Nimr, the executed cleric who spent more than a decade studying theology in Iran, a Shiite power, was a driving force behind 2011 anti-government protests in the Sunni kingdom of Saudi Arabia.
Following his execution Saturday, angry crowds hurled petrol bombs outside the Saudi embassy in Tehran before storming the building.
Protests also broke out in at least one city in Saudi Arabia's oil-rich Eastern Province, where Shiites complain of marginalization, as well as in Iraq and Bahrain.
Ban's spokesman said the UN chief was "deeply dismayed over the recent execution by Saudi Arabia of 47 people."
Deploring the violence outside the Saudi embassy in Tehran, he called for "calm and restraint" and urged "all regional leaders to work to avoid the exacerbation of sectarian tensions," his spokesman said in a statement.
Executions have soared in Saudi Arabia since King Salman ascended the throne a year ago.
Signup to our newsletter and follow us on Facebook and Twitter!
Rights groups have repeatedly raised concerns about the fairness of trials in the kingdom, where murder, drug trafficking, armed robbery, rape and apostasy are all punishable by death.
"Sheik al-Nimr and a number of the other prisoners executed had been convicted following trials that raised serious concerns over the nature of the charges and the fairness of the process," Ban's spokesman said.
The UN leader had raised Nimr's case "with the leadership of the Kingdom of Saudi Arabia on a number of occasions," the statement added.
Saudi Arabia's interior ministry said the executed men had been convicted of adopting the radical "takfiri" ideology, joining "terrorist organizations" and implementing various "criminal plots."
Ban was quoted as restating "his strong stance against the death penalty."
"He points to the growing movement in the international community for the abolition of capital punishment and urges Saudi Arabia to commute all death sentences imposed in the kingdom."
All those executed were Saudis, except for an Egyptian and a Chadian.