Russia's Daler Kuzyaev scored in the 3rd minute of play. Kuzyev and his teammate Nikolai Komlichenko, who put a dagger-like shot into the San Marino goal in the 78th minute of the match, recorded their first score for the Russian national team.
Other goals were scored by Sergey Petrov, Aleksey Miranchuk, Aleksey Ionov.
Russia and San Marino were competing in Group I of the UEFA Euro 2020 qualification round, along with Belgium, Kazakhstan, Cyprus, and Scotland.
Russia and Belgium have secured participation in the 2020 UEFA European Football Championship, while Scotland is set to play in the play-offs in March next year.
The final stage of the football tournament will be held from 12 June to 12 July next year across 12 cities: Amsterdam, Baku, Bilbao, Bucharest, Budapest, Copenhagen, Dublin, Glasgow, London, Munich, Rome and St. Petersburg. The latter's stadium on Krestovsky Island will host three matches of the group stage and one quarterfinal.
UEFA said it had received a record 19.3 million applications for 1.5 million Euro 2020 tickets, far more than 11 million applications for Euro 2016. Applications came from 204 countries, and most were received from the United Kingdom, Hungary, Germany, the Netherlands and Russia.