The luck of being the millionth visitor fell to IT expert Kristaps Šūlmeisters, who was greeted with applause and a cake.
"This event is like a little surprise," he said, wishing the library to welcome one more million visitors within the next three years.
More than 120,000 people are registered as readers at the National Library. About 1,000 people visit the library each workday, while the number soars to 1,500-2,000 during the weekend.
In 2016 a total 2,485 tours of the building took place with about 40,000 visitors being guided in Latvian, Russian, English, German, Polish, Finnish, Japanese and Chinese.
The new National Library building was erected between 2008 and 2013 and opened its doors in 2014.