Ex-Italian Premier Silvio Berlusconi left a hospital Tuesday three weeks after undergoing heart surgery, saying he hopes to still be useful to Italians but lamenting the current state of Italy, Europe and the world.

The 79-year-old Berlusconi walked slowly and gingerly, clutching the shoulder of an aide as he emerged Tuesday from the San Raffaele clinic in Milan. He had undergone surgery to replace a malfunctioning heart valve on June 14.

The three-time premier and media mogul told reporters waiting outside that he was feeling better but that the ordeal had been "very very painful." He said he would undergo two months of rehabilitation after which "I would hope to still be useful to Italy and Italians."

He said his greatest concern during his stay was not being able to sleep, but also the wave of terrorism striking the world and the "grave lack of leadership" in Europe that produced Britain's decision to leave the 28-nation European Union.

Sounding wistful and pensive, Berlusconi lamented that young people today don't remember the Cold War or the two World Wars that propelled the EU's founding fathers to unify. He voiced regret that during his term as EU president he was unable to bring the bloc together to form a cohesive foreign or defense policy.

And he voiced his greatest concern about domestic politics, with the "very dangerous" triumph of the grassroots, populist 5 Star Movement that recently took key mayorships in Rome and Turin, to the detriment of Italy's traditional center-left and center-right political blocs.

"I think there's a lot to do in our country, but always with love toward others and good sense, this affection for the interests of the country that I see in this moment is absolutely lacking," he said.

Berlusconi was initially admitted to the hospital on June 5 suffering from what his personal doctor had said was a potentially fatal heart-valve problem. Surgeons replaced the valve and reported no complications.

After dominating Italian politics for two decades, Berlusconi no longer holds public office due to a 2013 tax fraud conviction. But he remains head of his Forza Italia party and has been active in local campaigns.

Berlusconi's business interests include the Mediaset media empire, the Mondadori publishing house and the AC Milan Serie A soccer club that he has been trying to sell.