Sir David, whose previous wins include an Academy Fellowship lifetime achievement award in 1980, said: "Our thanks, of course, go to the spitting cobras, axolotls, golden frogs, dwarf chameleons, those happy tortoises, and this belongs not to me or to them but the production team."
He said he had no plans to retire and was "going off to Antarctica next to look at penguins".
Attenborough thanks the animals
The Bill, meanwhile, beat EastEnders, Casualty and Emmerdale to the continuing drama trophy, earning the ITV police show its first Bafta in 25 years.
Earlier this year, ITV announced that The Bill was being cut from two episodes a week to one.
EastEnders also lost out in the best actress category, where June Brown, who plays Dot Cotton, was the first soap star to be nominated since 1988.
The 82-year-old, who has played Dot Cotton (now Branning) since EastEnders' launch in 1985, was cited for a January 2008 episode in which she appeared alone.
But the best actress gong went to Anna Maxwell Martin for her role as a mental health patient in Channel 4's Poppy Shakespeare. She won the same award for Bleak House in 2005.
Stephen Dillane was named best actor for playing a grieving father in The Shooting of Thomas Hurndall, also on Channel 4.
Meanwhile, Wallander, starring Kenneth Branagh, was named best drama series, earning the actor his first TV Bafta - 20 years after he won a film Bafta for Henry V.
He said it was "marvellous" to win, and thanked the BBC for commissioning the programme, based on the detective novels by Swedish author Henning Mankell.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.