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.
Labour and Conservatives accused the SNP of cynically using childcare to boost its chances of winning the independence referendum.
The policy is the latest justification for an "unpopular" plan to leave the UK, according to Labour leader Johann Lamont.
"I have to be honest, both as a mother, as someone who taught some of the poorest children in our communities for 20 years, school meals would not be my priority in addressing child poverty," she told Parliament.
"We have said, as the First Minister has said before the holidays, that we make our priority the 10,000 vulnerable children who would benefit from better childcare.
"Six weeks ago, it was the First Minister's priorities, and for all the noise from his front bench, it is not his priority now.
"Rather than help families now, he chooses to make it a false offer for a referendum when he has the power to do so now.
"He makes them wait so he can engineer a false argument for changing the constitution."
The SNP wants independence "for better or worse", she said.
Conservative leader Ruth Davidson pointed out that the SNP had made a promise about school meals in their 2007 election manifesto.
"Nearly seven years in government, and let's look at the record," she said.
"Class sizes going up not down, PE promises broken, school-college partnerships still in the in-tray while the student debt write-off's landed firmly in the bin."
The SNP has now been embarrassed into making a pledge to copy Tory-Lib Dem UK policy, she said.
"A cynic might say that the SNP, having promised the earth and failed to deliver for years, has only now re-discovered its commitment to free school meals because the coalition government is delivering it," she told MSPs.
Liberal Democrat leader Willie Rennie said: "I welcome the commitment to free school meals, because there are significant numbers of children who don't benefit from free school meals because even though they are poor they don't qualify.
"So having this rounded policy that expands it to all young children is a welcome development, and will actually help to change the life chances of young children, despite what the critics say.
"But none of this stuff would be happening if Nick Clegg hadn't taken the step last autumn, because the Scottish Government weren't moving very fast on free school meals up to that point."
SNP MSP George Adam said: "Opposition parties such as Labour say we will stop at nothing to get what we want.
"That's true, we will stop at nothing to build a better future for the young people of Scotland, to give them hope and the vision that they can be everything they can be.
"That's what we will stop at nothing to do, and an independent Scotland gives us the opportunity to create that."
Labour MSP Neil Bibby said: "Parents have been let down badly by the SNP's inaction time and time again.
"The Scottish Government have chosen to spend money on things other than childcare in this budget and every other budget since 2007.
"The SNP won't deliver the first stage of their White Paper plans just now because they don't want prove the point that is obvious to everyone: that the don't need to break up the UK to increase childcare.
"That's cynical politics at its worst and just goes to show that the SNP will say anything to get a vote for separation."
The measures were welcomed by charities, trade unions and campaign groups.
Graeme Brown, director of Shelter Scotland, said: "Coming against the backdrop of further cuts in welfare - with more drastic reductions threatened yesterday by Chancellor George Osborne - free school meals for pupils in P1 to P3 is a direct and proven way of supporting, in particular, families on low or limited incomes and helping all schoolchildren in Scotland enjoy a better, healthier start to their primary education."
John Dickie, head of the Child Poverty Action Group in Scotland, said: "A universal approach to healthy free school lunches provides a huge boost to children and parents at a time when they are under increasing pressure from tax credit and benefit cuts, soaring food and energy prices and stagnating wages."
The Educational Institute of Scotland teaching union has campaigned for action to reduce child poverty.
General secretary Larry Flanagan said: "This is an important and significant step and the Scottish Government is to be congratulated on taking this action.
"Poverty is the greatest barrier to educational attainment and so it is essential that we continue to combat child poverty to ensure that all young people have a fair chance to achieve their potential."
Free school meals and expansion of childcare were also welcomed by the trade union GMB Scotland and charity Save the Children.