She said she was experiencing "mild symptoms" and would follow Scottish government guidance to work from home for the next few days.
Earlier on Friday she had held talks with Sinn Féin vice president Michelle O'Neill at her Bute House residence in Edinburgh.
Ms Sturgeon also returned from a visit to the US this week, where she had issued a warning over climate change.
She addressed the Brookings Institute and met US Speaker of the House Nancy Pelosi in Washington DC.
In a social media post, the first minister wrote: "Unfortunately I've tested positive for Covid this evening after experiencing mild symptoms.
"In line with Scottish government guidance, I'll work from home over next few days, and hopefully be back out and about later next week."
Sinn Fein confirmed Michelle O'Neill had tested negative for Covid following the meeting with Ms Sturgeon.
The party said Ms O'Neill would be tested again on Saturday "as a precaution" and would be limiting her contacts over the coming days.
Ms Sturgeon's positive test comes as the number of Covid-19 infections in Scotland continues to fall, according to figures from the Office for National Statistics (ONS).
The ONS estimates there were about 104,400 positive cases in the week to 13 May - about one in 45 people.
The number of hospital patients testing positive for Covid and weekly deaths are also falling.
Restrictions put in place over the pandemic were lifted as Scotland moved to living with Covid.
From 1 May, public health advice has been to "stay at home" if you feel unwell or have a fever.
People without symptoms are also no longer advised to take regular tests.
People who have Covid symptoms, a fever or are what the Scottish government describes as "too unwell to carry out normal activities" are asked to stay at home until they get better.