Video clips of Ms Marin, 36, at a party with Finnish celebrities emerged last week.
They were soon published by several media outlets in Finland and picked up around the world.
On Thursday, Ms Marin said she was upset that the videos had been published online as they were meant to be seen only by friends.
Ms Marin, who became the world's youngest serving government leader in December 2019, confirmed on Friday that she would be taking a drug test.
She said she had never taken drugs and that she had not seen anyone doing so at the party she attended.
Ms Marin confirmed she would take a drug test after the clip went viral Reuters
Social Democrat leader Ms Marin also said her ability to perform her official duties had remained unimpaired on the Saturday night in question and that she would have left the party had she been required to work.
Defending her actions, she said: "I haven't used drugs, I haven't used anything other than alcohol.
"I have nothing to conceal or hide, and I haven't done anything illegal.
"These are private videos and are not intended for the public.
"I'm still going to be friends with my friends."
A huge number of Finns voiced support for their leader, despite some raising questions about her judgement.
Sports presenter Aleksi Valavuori had urged Ms Marin to resign – but appears to be in the minority.
He said: "Some been saying she’s cool, maybe among other teenagers.
"She is by far the most incompetent prime minister we ever had. Knows nothing. Please take your leather jacket and resign."
Finnish Prime Minister Sanna Marin in the viral video Twitter