The 79-year-old will undergo surgery by the middle of next week to replace a defective aortic valve, Alberto Zangrillo told reporters in Rome.
Berlusconi served as prime minister four times but has since been convicted of tax fraud and bribery.
His political influence has waned since he left office in 2011.
Dr Zangrillo said Berlusconi had "arrived at the hospital in a severe state".
"He risked his life, he risked dying and he knew it... We have identified in an exact and certain way a pathology of aortic valve that is called aortic insufficiency," the doctor said.
"There's only one way to correct it, which is the substitution of the aortic valve."
The physician added that his patient had been shocked by the news.
"At the beginning he didn't want to believe it," he was quoted as saying by Reuters news agency.
"For a man who wants to live to be 130, this is a very unpleasant jolt."
Berlusconi, a billionaire businessman who leads the Forza Italia party, was taken into hospital for tests in his home city, Milan, earlier this week.
A spokeswoman for the party said at the time his condition was not life-threatening.
Along with his various legal battles in recent years, he was ejected from the Senate in 2013 after a conviction for tax fraud.
His preferred candidate in Rome's mayoral election on Sunday, property tycoon Alfio Marchini, made such a poor showing that he failed to make the run-off round.
Berlusconi's business interests include the Mediaset TV company and football team AC Milan.
News that was in hospital pushed shares in Mediaset up 2%, Reuters reported on Tuesday.
Traders said the episode might induce the family to make succession arrangements that could provide new investment opportunities for the market.
Former Italian Prime Minister Silvio Berlusconi is to have heart surgery after an attack that could have killed him, his doctor says.