MILAN—Former Italian Premier Silvio Berlusconi will undergo surgery to replace a defective aortic valve that is potentially life-threatening, his doctor said Thursday.

Over the weekend, the three-time premier suffered what his doctor called a “cardiac deficiency.” He was hospitalized late Sunday in Milan after returning from Rome, where the 79-year-old voted in the city’s local elections.

He has since remained hospitalized in San Raffaele Hospital, undergoing exams that lasted until Wednesday. Those tests found that he suffered from a defective valve that, if untreated, could have proved fatal.

“He risked dying,” said Alberto Zangrillo, the personal doctor of the media mogul and longtime leader of Italy’s conservative wing.

Mr. Berlusconi will undergo open heart surgery next week to replace his aortic valve with a new one, Dr. Zangrillo said. The four-hour operation at San Raffaele presents some risks, and the former premier is expected to face a month-long rehabilitation following the surgery. After that, Mr. Berlusconi’s “vitality will improve,” Dr. Zangrillo said, adding that the billionaire is in good spirits.