Almost nine in ten secondary-school teachers say that pupils in their establishment have suffered homophobic bullying, according to a new report.

In primary schools almost four in ten (39%) teachers say it is a problem while among secondary-school staff the figure is 88%, the Stonewall Scotland study found.

However, nine in ten primary-school staff (89%) and more than four in five secondary-school workers (83%) have not received any specific training on how to tackle homophobic bullying.

The YouGov survey for Stonewall also found that almost a third of primary-school staff in Scotland (32%) and nearly a third of secondary-school staff (31%) have heard homophobic language or negative remarks about lesbian, gay and bisexual people from other school employees.

The study - The Teachers' Report 2014 - sets out several recommendations on how to tackle the problem.

Stonewall Scotland director Colin Macfarlane said: "Teachers are the most powerful tool that we have in the fight to tackle homophobic bullying.

"Sadly, our new research shows that 15 years since the repeal of Section 28 in Scotland, it still casts a shadow over our schools.

"It is troubling that so many teachers report that they have never received any specific training on how to tackle homophobic bullying.

"That's why this year Stonewall Scotland launched a Train the Trainer programme which means we can work directly with teachers across Scotland.

"However, the responsibility cannot be ours alone. The Scottish Government, local authorities, schools and other agencies must now make it a priority that every single teacher is trained to tackle all types of bullying and abuse in our schools."

The report also noted confusion among teachers almost 15 years after the repeal of section 28, which banned the promotion of homosexuality in schools.

It found that 75% of primary and 44% of secondary-school staff say they either are not allowed to or are not sure if they are allowed to teach about lesbian, gay, bisexual and transgender issues in their school.

Almost a third of primary-school staff in Scotland (30%) say their school does not allow them to teach about lesbian, gay or bisexual issues while for secondary-school staff the figure is 9%.

The report calls on the Scottish Government to ensure its anti-bullying strategy and guidance explicitly states all schools' duty to tackle homophobic, biphobic and transphobic bullying

Other recommendations include a call for the Scottish Government to provide clear guidance stating that LGBT issues should be included in the curriculum as part of schools' strategies to prevent bullying, and the development of a consistent national approach for recording and monitoring homophobic, biphobic and transphobic bullying in all Scottish schools.

A Scottish Government spokesman said: "We want every child and young person in Scotland to grow up free from bullying and we want them to develop mutually respectful, responsible and confident relationships with other children, young people and adults.

"Every secondary school in Scotland has been sent guidance on dealing with homophobia and homophobic bullying, as well as the filmed adaptation of Stonewall's highly-successful play for schools.

"Our national approach to anti-bullying sets out a common vision and aims to make sure that work across all agencies and communities is jointly focused on tackling bullying.

"We expect that all schools develop and implement an anti-bullying policy, which should be reviewed and updated on a regular basis.

"To support this we have established and wholly fund respectme, a national anti-bullying service, to build confidence and capacity to tackle all bullying, including prejudice-based bullying, effectively."

The YouGov survey questioned 122 primary staff and 138 secondary staff in Scotland as part of a survey of 1,832 primary and secondary teachers and non-teaching staff across Britain.