Mikhail Kalashnikov, designer of the legendary AK-47 assault rifle, turned to the head of the Russian Orthodox Church in the months before his death to express remorse for those killed by his invention.

Kalashnikov, who died in December at the age of 94, in April wrote a lengthy emotional letter to Russian Orthodox Church Patriarch Kirill, Izvestia, a pro-Kremlin daily, reported on Monday.

The Soviet-era legend and Russian national hero had visited an intensive care unit with heart problems only months earlier, and he was spending more and more time in hospital at the time he sent his letter to the Church.

“My spiritual pain is unbearable. I keep having the same unsolved question: if my rifle took away people’s lives, then can it be that I… am guilty for people’s deaths, even if they were enemies?” Kalashnikov asked.

The typed letter on Kalashnikov’s personal writing paper, reproduced by Izvestia, is signed with a wavering hand by the man who describes himself as “a slave of God, the designer Mikhail Kalashnikov.”

Kalashnikov, whose funeral was attended by President Vladimir Putin, came up with the durable and simple rifle design after experiencing the Red Army’s dire lack of weapons during World War II.

Now the AK-47 is widely manufactured unlicenced around the world and has become a visual hallmark of armed insurgent movements, including those using child soldiers.

Kalashnikov wrote that he first went into a church at the age of 91 and was later baptised.

“The Lord showed me the way in the afternoon of my life,” wrote the rifle inventor. “When at the age of 91 I cross the threshold of a church, my soul felt as if it had been there before.”

The Patriarch’s press secretary, Alexander Volkov, told Izvestia that the Russian Church leader received the letter and wrote a personal reply.

“The Church has a very definite position: when weapons serve to protect the Fatherland, the Church supports both its creators and the soldiers who use it,” Volkov said.

“He designed this rifle to defend his country, not so terrorists could use it in Saudi Arabia.”

The Russian Orthodox Church has sought to consolidate its new-found strength after the Soviet era by building up close ties with state agencies and powerful officials.

When Kalashnikov was feted by the Soviet authorities, it would have been unthinkable for him to have declared himself anything else than an atheist.

His daughter, Yelena, told Izvestia: “Of course you can’t say he went to services or lived strictly according to the commandments. You have to understand his generation.”

Kalashnikov designed his famous rifles at the Izmash factory in the central city of Izhevsk and lived in the struggling region until his last days despite offers to come to Moscow.

The 206-year-old plant remains one of the main producers of Russian weapons and is treasured as a national icon.