Scotland's largest city will receive more than a sixth of a new £120 million cash fund set up as part of efforts to close the attainment gap in schools.

A total of £21,602,400 from the Scottish Government's Pupil Equity Funding scheme is going to schools in the Glasgow City Council area.

Education Secretary John Swinney has revealed details of funding allocations to about 2,300 schools across Scotland.

St Andrew's Secondary School in Glasgow will receive the largest individual award of £354,000.

First Minister Nicola Sturgeon's former schools, Dreghorn Primary and Greenwood Academy in North Ayrshire, will receive £74,400 and £178,800 respectively.

The amount of cash each school receives is linked to the number of youngsters who meet the criteria for free school meals, with head teachers being given about £1,200 per pupil, according to the Scottish Government.

Schools in the Moray area are in line for £1,270,800, while £9,787,200 will go to schools in Fife, £8,871,600 in North Lanarkshire, £7,867,200 in South Lanarkshire, and £7,472,400 will help schools in the Edinburgh City Council area.

Ministers had previously planned to fund the scheme with money raised from changes to the council tax system, but this sparked an angry backlash from local authorities.

Finance Secretary Derek Mackay then announced in his Budget that the Scottish Government would pick up the tab.

Mr Swinney revealed the funding breakdown on a visit to Dalmarnock Primary School in Glasgow's east end - which will benefit from £278,400.

He said: "This Government has made clear our priority is to close the poverty-related attainment gap and our new £120 million Pupil Equity Funding is aimed at doing just that.

"We are providing additional ring-fenced funding which will enable individual schools to target support where it is needed the most.

"The allocations I am announcing today will let parents, teachers and school leaders see how much funding their schools will receive in 2017-18 to help break the inter-generational cycle of deprivation."

He stressed the money for the scheme "is on top of the existing £50 million Attainment Scotland funding" and is also in addition to "action being taken by this Government to raise standards for all and make the improvements that are necessary to make Scottish education world-class".

The EIS, Scotland's largest teaching union, welcomed the cash but stressed it must not replace schools' core funding from local authorities.

General secretary Larry Flanagan added: "This additional £120 million investment in our schools will help to support valuable initiatives which aim to tackle the attainment gap and reduce the damaging impact that poverty has on the educational experience of too many young people across Scotland.

"For far too long, the greatest factor impacting on pupil attainment has been the level of family income - a situation that has only been made worse by austerity politics and cuts to public services, including education."

Labour and the Greens said the cash was being awarded at a time when councils are facing budget cuts.

Labour education spokesman Daniel Johnson said: "The SNP sums simply don't add up on schools funding. Ministers cannot cut the gap between the richest and the rest while they slash £327 million from local education budgets across Scotland.

"Head teachers will see this new funding alongside shrinking budgets, so it's simply SNP spin after £1.4 billion of cuts since 2011."

Greens education spokesman Ross Greer said: "Scottish ministers describe this money as additional but that's just not true when they are proposing deep cuts to council budgets, where funding for our schools and teachers comes from.

"If we're really going to close the gap between the most and least privileged children we won't do it through education alone. We need to eradicate child poverty through better paying jobs, warmer and more affordable homes and strong public services, which Greens are fighting for in Parliament and in councils across Scotland."

The Tories raised concerns that a higher proportion of schools in Scotland will miss out on funding when compared to a similar scheme south of the border.

A total of 114 schools out of 2,500 in Scotland will not receive any cash, according to the Conservatives, compared to 133 schools out 21,500 in England.

Education spokeswoman Liz Smith described the new scheme as a welcome move which will "hopefully go some way to closing Scotland's stubborn attainment gap".

But she added: "It's essential no pupils who need it miss out on this cash.

"There does appear to be a higher number of schools in Scotland being left out than in England.

"Now the Scottish Government needs to provide assurances that this is because the money there is not needed, rather than a fault in methodology."