The measure, which will be introduced from January next year, matches a scheme being brought in south of the border.
It is being funded with the extra money which will be received by the Scottish Government as a budget consequence of Westminster's plans for schools in England.
During a debate on Scotland's future at Holyrood, Mr Salmond told MSPs that free meals in Scotland would be funded with £114 million over the next two years, saving families at least £330 for each child.
"The announcements that we make today will have the greatest possible effect given the resources available to us," Mr Salmond said.
"Under this Government, Scotland has made free meals available in every primary school to families which receive child and working tax credits. A step which hasn't being taken in England and Wales, and which has contributed to 10,000 more pupils registering for free school meals.
"Now I am delighted to tell this chamber that we can go further. I can announce today that after discussions with our partners in local government, we will fund free school meals for all children in P1 to P3 from next January.
"That measure will build on and learn from the pilots we established in the five local authority areas in 2007/08.
"It will remove any possibility of free meals being a source of stigma during the first years of a child's schooling, it will improve health and wellbeing, and will be worth crucially £330 each year for each child to families across the country."
Mr Salmond also announced plans to further expand free childcare, starting with two-year-olds from the most deprived backgrounds.
From August this year, every two-year-old from a "workless" family will be entitled to 600 hours of free childcare, representing 15% of two-year-olds.
From August next year free childcare provision will be extended further, reaching 27% of all two-year-olds, by widening the entitlement to families who receive certain welfare benefits such as income support.
The plans build on existing measures in Children and Young People's Bill to provide free childcare to all two-year-olds in care.
"By August 2015, the overall level of free learning and care being delivered for two, three and four-year-olds in Scotland will exceed that which is promised elsewhere in the UK," Mr Salmond said.
"These are important and immediate announcements, but they fall short, I readily admit, of the transformation that is required in Scottish society.
"We need to create a tax, welfare and childcare system that doesn't plunge children into poverty as the UK Government is doing, that puts us on a par with the best childcare systems in the world.
"And that is why the future of Scotland's children is the future of Scotland, and why Scotland's future is an independent one."
The Government said free school meals will cost £13 million in 2014/15 and £42 million in 2015/16. The expansion of childcare will cost £15 million in 2014/15 and £44 million in 2015/16.
The Scottish budget was boosted by an additional £308 million in extra devolved spending following the UK Government's Autumn Statement.
Mr Salmond said this funding was dwarfed by overall reductions in the Scottish budget.