NEW YORK — James Avery, the character actor who laid down the law at home and on the job as the Honorable Philip Banks in “The Fresh Prince of Bel-Air,” has died.

Mr. Avery’s publicist, Cynthia Snyder, said he died Tuesday in Glendale, Calif., after complications from open-heart surgery. He was 68, Snyder said.

Mr. Avery played the family patriarch and a wealthy attorney and judge on the popular TV comedy that launched the acting career of Will Smith as Banks’ troublemaking nephew.

The sitcom, which aired on NBC from 1990 to 1996, was set in the Banks’ mansion, to which Smith’s character was sent from Philadelphia when things got tough in his own neighborhood. Fans came to know the imposing Banks as “Uncle Phil,” who was ranked No. 34 on TV Guide’s 50 Greatest TV Dads of All Time.

    Most Read Stories

Mr. Avery liked to say that the way to be an actor was to act, and he had a busy and diverse career before, during and after “Fresh Prince.”

The Virginia-born, New Jersey-raised actor first appeared on the screen in an uncredited role in 1980’s “The Blues Brothers” and turned up as a regular on such TV series as “L.A. Law,” “Beauty and the Beast,” “Sparks,” “Grey’s Anatomy,” “NYPD Blue” and “Dallas”; among his many films were “Fletch,” “Nightflyers” and “8 Million Ways to Die.” His voice also brought him many jobs, notably as Shredder in the animated TV series “Teenage Mutant Ninja Turtles.”

But Mr. Avery’s role as “Uncle Phil” on “Fresh Prince” brought him his widest audience.

According to Snyder, he will be seen in the film “Wish I Was Here,” directed by Zach Braff and scheduled to premiere this month at the Sundance Film Festival.

Mr. Avery grew up in Atlantic City, N.J., and served in the Navy in Vietnam in the late 1960s. After the war, he settled in California and studied drama and literature at the University of California, San Diego.

He is survived by his wife of 26 years, Barbara; his mother, Florence Avery; and his stepson, Kevin Waters.

Material from the Los Angeles Times is included in this report.