Sergei Mikhalkov: Russian author of plays, screenplays and children's literature who penned the words to the National Anthem of the Soviet Union

Sergei Mikhalkov was one of the most popular – and loyal – Soviet authors, best remembered for writing three different texts for the national anthem to suit, in turn, Stalin, Brezhnev and Putin. Though he specialised in children's literature, he also wrote plays, screenplays and memoirs.

Both the Mikhalkovs and, on his mother's side, the Glebovs, were prominent politicians and soldiers, and his father's aristocratic roots stretched back to the 15th century. Mikhalkov's father studied law but turned to agricultural research, specialising in poultry. Sergei, named after his great-grandfather, was the eldest of three boys who had a German governess, and he enjoyed poetry, including the fables of Pushkin and Krylov.

Mikhalkov wrote verse from early childhood and his father, seeing talent, sent some to the impeccably loyal poet Alexander Bezymensky, who encouraged him. When Mikhalkov was 14 the family moved to Stavropol and a year later his first poem, "The Road", was published. That year he joined the Tver Association of Proletarian Writers and his work was published regularly in Piatigorsk, where he was studying. He later worked in a Moscow textile factory and on a geological expedition to Kazakhstan.

By 1933 he was a professional writer for, amongst others, Izvestiya. But in 1935 he started two years' study at the Gorky Institute of Literature. It was a crucial year: he wrote the first of several children's poems about Uncle Stopya (Uncle Steeple), a gigantic, though benign, policeman who later became a wartime sailor. They were (and remain) hugely popular. He also wooed a fellow student, Svetlana, promising to dedicate a poem to her in Izvestiya. In fact, he simply renamed a poem that was going to be published anyway. But it had the unintentional effect of catching the eye of Stalin, whose daughter shared the name.

However, in 1936 he married Natalia Konchalovskaya, a writer from a line of painters: her father was Piotr Konchalovsky and her grandfather Surikov. Initially double-barrelled, their two film-director sons, Nikita Mikhalkov and Andrei Konchalovsky, later divided their parents' names. Reading his children's poems, the "Comrade Count" Alexei Tolstoy suggested that Mikhalkov write fables. He eventually completed 200, some so laconic that they border on being gags, and they became equally popular.

Despite their aristocratic roots, the Mikhalkovs avoided the Terror, perhaps because of the Svetlana poem, Mikhalkov's popular and loyal verse and the fact that his brothers Mikhail and Alexander (also writers) were KGB agents. After being wounded as a war correspondent, he began his rise through literary politics, eventually becoming head of the Russian Writers' Union, a post he retained for over 20 years, into the period following perestroika. Nevertheless, like some other Soviet artists, he joined the Party only relatively late in life – in his case in 1950.

In 1942 he and Gabriel El-Ragistan co-wrote words for a new national anthem, praising the country and its Stalin-inspired strength. The leader made a few corrections, including removing a reference to "the people's will", which might have been confused with the 19th-century anarchist group. After trying various melodies (including one co-written by Shostakovich and Khachaturian), Alexander Alexandrov's tune was chosen. It was introduced on 1 January 1944, winning Mikhalkov his second Stalin Prize.

In 1949 the play Ilya Golovin brought a third. In the aftermath of the 1948 Musicians' Conference condemnation of Shostakovich, it tells of a composer who, after early success, starts writing "Formalist" music. However, advice from a Red Army friend gets him back on the right path and he earns Stalin's praise. Ironically, Shostakovich's friend Marshal Tukhachevsky had been purged in 1938.

In the 1950s the national anthem was de-Stalinised, removing Mikhalkov's words, but, firmly an official writer, in 1958 he joined the condemnation of Pasternak's Nobel Prize, as well as the later campaign against Solzhenitsyn. In 1977 the 60th anniversary of the Revolution was celebrated with a new text for the national anthem, which had been wordless for over twenty years. With Stalin beyond the pale, Mikhalkov turned his praise to Lenin.

Meanwhile, a literary fixture, he regularly praised the latest Soviet achievements and supervised The Fuse, a series of short films, which relieved some of the pressures of Brezhnev's stagnation by gently satirising its petty irritations.

Mikhalkov wrote three dozen plays, starting with a 1938 adaptation of Twain's The Prince and the Pauper, but, normally politically adroit, they include one of his rare mis-steps. In 1973 he adapted Modern Idyll, Saltykov-Shchedrin's satire about a liberal windbag. It was initially hailed but, despite a preface reassuringly pointing out that the action happens 100 years ago, its contemporary relevance was all too clear and it was withdrawn.

In 1997 he married the physicist Yulia Subbotina, 37 years his junior, inspiring a burst of creativity. Mikhalkov's second national anthem lasted until the Soviet Union's collapse and in 1991 Boris Yeltsin, decisively breaking with the past, ditched Alexandrov for Glinka. But in 2000 Mikhalkov was called on for a third time when Vladimir Putin revived Alexandrov's music. With both Stalin and Lenin off the menu, Mikhalkov urged loyalty to the Fatherland and praise to God. He claimed always to have been a believer, motivated by his family tradition of patriotism and public service. In this and his ability to dance around the flame of power, he has been followed by his son, the film-maker Nikita.

Putin marked Mikhalkov's 90th birthday with a personal visit and a national prize. Yet for all the popularity and honours at home he was rarely acknowledged overseas; several Western encyclopaedias of Russian literature omit him altogether. Even in Russia his significance is now seen as being at least as political as literary.

John Riley

Sergei Vladimirovich Mikhalkov, writer: born Moscow 12 March 1913 (27 February, Old Style); married firstly Natalia Petrovna Konchalovskaya (deceased 1988, two sons), secondly Yulia Valerievna Subbotina; died Moscow 27 August 2009.