In a report published by Health Protection Scotland (HPS) providing analysis to the end of December 2018, 91% (5,352) of those living with the condition had been diagnosed.
Of the total number of people diagnosed as having HIV, the majority are men - 73% (3,916) - while 1,436 women are estimated to have the virus.
The majority of the 5,532 diagnosed individuals are attending specialist HIV services for treatment and care, with 92% (4,913) doing so.
A total of 98% (4,799) of people attending services are reported as receiving antiretroviral therapy (ART) which involves the use of HIV medicines to treat HIV infection.
People on ART take a combination of HIV medicines (called an HIV treatment regimen) every day.
Around 94% (4,530) of people receiving ART are said to have achieved an undetectable viral load.
The figures outliine that Scotland has maintained the global UNAids "Fast Track" HIV 90-90-90 targets set for 2020 first met in September 2018 (90% of HIV infected individuals will be diagnosed and, of these, 90% will be receiving antiretroviral therapy (ART) and, of these, 90% will achieve an undetectable viral load).
HPS have said that while HIV treatment and care in Scotland is optimal, the main areas for public health action include reducing the number of HIV transmissions taking place, diagnosing infections early and to diagnose (or re-diagnose) early infected individuals who come to Scotland.
HIV Scotland chief executive Nathan Sparling said: "We have all the tools to prevent every new HIV transmission in Scotland and, as such, each new transmission must be considered a major incident. This means investigating where prevention tools could have been implemented, learning and improving our interventions.
"With effective treatments, HIV is a long-term manageable condition, but people who are diagnosed late have an increased chance of long-term health problems related to late diagnosis.
"We have seen a drop in the late diagnoses rate, which is welcome, but we must continue to improve access to testing for anyone vulnerable to HIV to ensure they can access treatment as soon as possible. Too many people are being hospitalised with HIV due to late diagnosis."
He added: "A concerning statistic in the report is the number of young people who are not attending services to access treatment.
"This highlights the impact of stigma and the need for education in schools to combat myths and misconceptions about HIV. Stigma prevents access to treatment, and a wide-spread public campaign could be the answer to combat it.
"Through education and public awareness, we can improve all of Scotland's knowledge about the fact that people living with HIV, on effective treatment with an undetectable viral load, can't pass it on to their sexual partners. That message must be heard by everyone.
"This new report shows that with continued efforts, our plan to get to zero new HIV transmissions is more than achievable."