Placed at No.209 in the latest FIFA rankings, joint-bottom with Anguilla, San Marino's run without a goal on home soil stretched back 20 matches since a 5-1 loss against Poland in September 2013.
It had also failed to find the net home or away since Mirko Palazzi's consolation goal in a 5-1 reverse at the hands of Azerbaijan 26 months ago, suffering 9-0 defeats to Russia and Belgium and an 8-0 loss to Norway during that streak.
Those barren goalscoring runs ended in the qualifying clash with Kazakhstan in Serravalle thanks to Filippo Berardi's second-half strike.
The 22-year-old winger, who plies his club trade for Serie C side Vibonese, rounded opposition goalkeeper Dmytro Nepogodov after latching on to a throughball and slotted into an empty net.
San Marino, 3-0 down at the time of the goal, remains bottom of Group I without a point and with a goal difference of -45 from its nine matches.
It has lost 35 competitive games in a row since a 0-0 draw with Estonia in UEFA Euro 2016 qualifying five years ago.