The mayor, Muhammad Umar Habeb, also known as 'Muhammad Dhere', regretted the explosions. "I am very disappointed that the trip was cut short," he said. "It was exactly what those who were behind the explosions hoped for."
He said Holmes had not been in danger and "should have completed his programme".
Shortly after Holmes and his delegation arrived in Mogadishu on Saturday, the first of several explosions was reported from the K4 area, on Holmes's route to the UN compound.
"The K4 explosion [which killed four people] was aimed at a government security official," a local journalist said. "The others I think were meant for the UN people, as a message that all is not well."
Addressing reporters on Sunday in the Kenyan capital, Nairobi, Holmes said, overall, the trip was not satisfactory "since it was curtailed by these security incidents". He added it had begun "to look as though maybe a message was being sent".
Holmes and his delegation cancelled a tour of the city to view damage caused by recent fighting, as well as a visit to a hospital and a camp for internally displaced people, but met President Abdullahi Yusuf Ahmed and Prime Minister Ali Muhammad Gedi.
He said he had asked the transitional government to increase its cooperation with the humanitarian effort in terms of freedom of movement, access and fewer bureaucratic obstacles. However, while promising cooperation with humanitarian operations, the government claimed the international community was "massively exaggerating the problem".
Holmes also raised the question of abuses, violations of human rights and international humanitarian law, which the government denied. The government, however, accepted a proposal for a UN human rights team to visit the country to look into those allegations, he said.
The delegation also met civil society groups in Mogadishu.
"We met with Mr Holmes and expressed our views on the reconciliation process and the need to scale up assistance to the IDPs [internally displaced]," Muhammad Nur Ga'al, the deputy head of the coalition known as Civil Society in Action, said on Monday.
Ga'al said Holmes's trip was very important for the city, "which was under some kind of embargo. We hope that others will follow and come and contribute to the stabilisation of the city."
He said the presence of international organisations would "greatly contribute to the overall stabilisation of the city".
On the humanitarian situation, Holmes said the main problems were security, access and presence on the ground, but that the humanitarian community had been able to reach more people in the last week than before. However, he added: "We are a long way from covering the needs as we would like to."
He added there was a real desire in the UN - both in the secretariat and the security council - "to do more for Somalia to bring about a better situation and lasting peace". Progress was needed on four parallel "tracks", he said: humanitarian, human rights, politics and security.
Habeb said his administration would stabilise the city soon. "Within three months, inshallah, we will stabilise the city," he said. Holmes said, regarding the security situation, "there are limits of their [the government'] control over events on the ground".