More than half (52%) of people put the tree in first place in the three-month consultation run by Forestry Commission Scotland.
The rowan came second with 15% of votes while the holly was third with 7%.
Forestry Commission Scotland is now developing a funding package and a range of activities to help raise the profile of the Scots pine, such as projects with schools, conferences and seminars.
More than 4,500 people responded to the consultation.
Announcing its results during a members' debate in the Scottish Parliament, Environment and Climate Change Minister Paul Wheelhouse said: "Scotland's trees, forests and woodlands are some of our greatest and most treasured natural assets. We are rightly proud of them because they help shape our landscape and make Scotland the fantastic country that it is.
"The Scots pine was an obvious choice and certainly the people's choice. Its designation of being the national tree of Scotland will help create an iconic symbol to highlight the significant contribution trees make to our country."
The idea of a national tree of Scotland came from Alex Hamilton, a member of the public who brought his campaign to the Scottish Parliament through a petition and received cross-party support from MSPs.
He said: "I am delighted at the news and congratulate the Scottish Government. I look forward to this symbol of our beautiful and life-giving woodlands being embraced by all."
The national tree of Scotland is a symbolic designation which aims to help promote, celebrate and get people talking about trees, woodlands and forests.
Carol Evans, director of The Woodland Trust Scotland said: "I'm thrilled on behalf of the hundreds of our members and supporters who got involved with the consultation and who responded to our survey last year.
"The official consultation found a very similar result to our poll, which demonstrates the iconic status that the species has in Scotland.
"We have a wide range of native trees that are vitally important to our landscape and environment, but clearly there's something special about the Scots pine.
"Declaring a national tree is a symbolic gesture, but it's an important one. Our trees and woods are being put under increasing pressure from threats such as climate change, grazing and pests and diseases including Dothistroma needle blight, which affects Scots pine.
"These threats to our native trees and woods make it more important than ever to celebrate and value them, and also work to make them more resilient."