Robert Banks Stewart also wrote for hit TV dramas such as Doctor Who and The Darling Buds of May

Television writer Robert Banks Stewart, known for creating Bergerac and writing episodes of Doctor Who, has died aged 84.

Born in Edinburgh in 1931, Stewart also worked as a producer on shows including The Darling Buds of May, where he is said to have given the final casting vote for Catherine Zeta-Jones to play Pop Larkin's daughter.

The TV veteran died at home on Thursday after suffering from cancer, his son Andy Stewart said.

Among Stewart's creations was the Jersey-based detective Jim Bergerac - a divorced loner and recovering alcoholic who liked to drive his vintage sports car while solving a whole range of crimes.

John Nettles played the lead role and it was an instant success for the BBC, a Sunday night number one which ran for 10 years from 1981 to 1991.

Stewart wrote two stories for Doctor Who in the mid-seventies: The Seeds of Doom and The Terror of the Zygons. Starring Tom Baker as the Doctor, both are now regarded by fans as classics.

He was also behind Eddie Shoestring, a shambling but shrewd figure, played by newcomer Trevor Eve in 1979.

Shoestring was a huge hit, dominating Sunday night viewing for two years, and gaining the number one position in the weekly national TV ratings, as well as being nominated for a Bafta.

Perhaps one of the biggest successes of Stewart's career was the opening series of HE Bates' The Darling Buds of May, which gained one of the highest ratings for a new series in the history of British TV.

He is survived by his three sons from his second marriage and a daughter from his first.