10:46 AM PT -- We've just learned Avery had recently undergone open heart surgery and died from complications from the operation.
James Avery -- the beloved dad on "The Fresh Prince of Bel-Air" -- has died at age 65 .. TMZ has learned.
Sources close to the actor tell TMZ he died in an L.A. hospital last night. Avery had recently undergone surgery for an undisclosed illness and took a turn for the worse late yesterday.
And we're told ... his wife, Barbara, had been at his bedside but left for a short period of time and when she came back ... she learned he had just died.
Alfonso Ribeiro -- who played Avery's son on "Fresh Prince" -- just posted a message on his Facebook page.
Avery starred in dozens of TV shows through the years -- shows like "Grey's Anatomy," "The Closer," "L.A. Law," and "The Jeffersons." This past year, he appeared in three TV movies -- most recently, "Go, Bolivia, Go!" -- but didn't appear to have other projects in the works.
Avery reunited with most of hi...ince" cast -- including Will Smith -- two years ago at a charity event.
Story developing..
James Avery -- who played Uncle Phil on "Fresh Prince of Bel Air -- was suffering from several major medical problems for years before he died from complications following an open heart surgery, TMZ has learned.
We've obtained the death certificate, filed in L.A., which shows the 68-year-old suffered from severe coronary heart disease -- along with end-stage kidney disease and type-2 diabetes.
Avery's official cause of death is listed as cardiorespiratory arrest -- which basically means his heart stopped.
TMZ broke the story, Avery passed away in a Glendale, CA hospital on Dec. 31 -- roughly 7 weeks after undergoing a bypass surgery in the wake of a heart attack.
The death certificate also says Avery was cremated and his remains were scattered at sea off the coast of L.A.