Vladimir Putin's paternal grandfather worked as a cook for both Vladimir Lenin and Joseph Stalin, the president said in a film posted on the internet on Sunday.

In the two-hour documentary, called Putin, the president said Spiridon Putin was a valued member of Stalin's staff. The wartime Soviet leader, who died in 1953, conducted extensive purges during his around three decades in power.

"(He) was a cook at Lenin's and later at Stalin's, at one of the dachas in the Moscow area," Putin said in the film seen by Reuters.

Interviewer Andrey Kondrashov, who became the president's election campaign spokesman in January, said Spiridon Putin continued to cook for the Soviet establishment until shortly before he died in 1965, aged 86.

Kremlin spokesman Dmitry Peskov said the information in the film was accurate.