Latvians went to bed on Sunday expecting to go to work.
But the Latvian parliament met at midnight to declare Monday a holiday after the national ice hockey team chalked up its best-ever result at the world championship.
Latvia, where hockey is the national sport, was co-hosting the men's championship with Finland, and the Latvians' extra-time victory over the US for third place was greeted with wild jubilation. Canada won gold, Germany silver.
An airBaltic plane bringing the team home from Finland made a low-altitude fly-past over central Riga to greet thousands of fans gathered to welcome the squad.
At quarter to midnight on Sunday, sporting red and white national team jerseys, members of parliament convened for a ten-minute session to declare the holiday unanimously.
It was "to strengthen the fact of significant success of Latvian athletes in the social memory of the society", according to the bill's sponsors.
The bill was introduced by a smiling member of parliament with her face painted in the colours of the national flag. Another giggled merrily while trying to read out the names of absent parliamentarians, to laughter from many in the hall.
There was an ovation from everyone present after the final vote.
But as dawn broke after the midnight sitting, there was confusion about who was working and who was not.
Court hearings were cancelled and schools and universities were closed, but national exams for high school students went ahead, with staff paid at holiday rates.
Businesses found themselves in some disarray when the President of the Latvian Chamber of Commerce and Industry, Aigars Rostovskis, told public broadcaster LSM: "It will be chaos for many".
Several hospitals chose to stay open to honour doctor's appointments.