Roger Moore, the dapper British actor who brought tongue-in-cheek humor to the James Bond persona in seven films, eclipsing his television career, which had included starring roles in at least five series, died on Tuesday in Switzerland. He was 89.

The death, attributed to cancer, was confirmed in a family statement on Twitter. His family did not say where in Switzerland he had died.

Mr. Moore was the oldest Bond ever hired for films in the official series — although David Niven was in his 50s when he played Bond in the spoof “Casino Royale” — taking on the role when he was 45. (Sean Connery, who originated the film character and with whom Mr. Moore was constantly compared, was 32 when the first Bond film, “Dr. No,” was released.) Mr. Moore also had the longest run in the role, beginning in 1973 with “Live and Let Die” and winding up in 1985 with “A View to a Kill.”