James Avery, who played Will Smith’s pompous but well-meaning uncle on the popular 1990s sitcom “The Fresh Prince of Bel-Air,” died on Tuesday in Glendale, Calif. He was 68.

The cause was complications of heart surgery, said his mother, Florence J. Avery.

Mr. Avery played Philip Banks, a wealthy lawyer (later a judge) who becomes a surrogate father to his street-smart nephew, played by Mr. Smith, on “The Fresh Prince of Bel-Air,” seen on NBC from 1990 to 1996.

Reviewing the show in The New York Times early in its first season, John J. O’Connor said Mr. Smith — at the time a popular rapper just beginning his acting career — was “frequently overshadowed by the rest of the cast, particularly James Avery as the father and Karyn Parsons as the older daughter, Hilary.”

A classically trained actor with an imposing physical presence and a resonant voice, Mr. Avery was born on Nov. 27, 1945, in Pughsville, Va., near what is now Suffolk, and grew up in Atlantic City. In the late 1960s, he served in the Navy.