It is not the sort of place you would expect to see a soldier offering advice on how to use a gun.

The scale of armed forces visits to schools - including primaries - in Scotland can now be revealed by STV News, however, as well as evidence the Ministry of Defence (MoD) is deliberately pinpointing poorer areas.

A total of 927 visits to schools, colleges and universities were made in 2016/17, the largest number of which were in Glasgow, Aberdeenshire and Fife.

Scottish Government agency Education Scotland confirmed the MoD had asked for statistics on the deprivation rates in schools in 2015.

Eileen Prior from the Scottish Parent Teacher Council said parents were worried about the armed forces visiting their children at school.

She said: "I think there would be a lot of concern among parents that this is a recruitment drive.

"Parents are generally concerned about the armed forces going into schools, whether it be primary or secondary, and particularly in more deprived areas where perhaps the armed forces might be seen as one of the few routes to a career."

Of the country's 361 state secondary schools, 68% (244) were visited by a branch of the armed forces during the period.

At least eight visits were made to primary schools.

In January, a group of Royal Marines visited a primary school in Argyll and Bute with unloaded weapons.

Following a complaint by a parent, the commandos have been told not to bring weapons on to the premises on future visits.

A Scottish Parliament committee is currently examining a petition which calls for tighter regulation of military visits to schools.

Four members from each of the three services and the MoD appeared in front of the public petitions committee on Thursday.

Holyrood authorities accepted not to show the panellists' faces on the video recording of the committee over fears of their personal safety despite some of the witnesses walking to the Scottish Parliament in full uniform.

Major Deborah Scott told MSPs: "I myself have been into a primary school where I have shown my respirator and webbing.

"That's the sort of thing we'd do. It wouldn't be a careers-based visit, it would be a 'what's the army about?'"

Every single secondary school in four council areas - Stirling, North Ayrshire, Clackmannanshire and Perth and Kinross - was visited.

A total of 47 schools in the country were visited five times or more during the period, 42% of all state school visits.

Schools in all but one of Scotland's 32 council areas, Shetland, have been visited by military personnel.

Airdrie Academy in North Lanarkshire topped the last with 15 separate engagements during the period.

Across all three armed services, 75.4% of visits to schools were focused around careers.

The MoD insists no recruitment takes place inside schools as pupils cannot enlist there and then. Those wishing to join the forces must apply online.

An MOD spokesman said: "Our Armed Forces are often invited by schools to talk to students about military life. This engagement helps young people learn about the Armed Forces and issues which affect the military."

The data obtained by STV News has been processed by Forces Watch, an organisation which scrutinises the armed forces and their recruitment practices. You can read a summarised report of the statistics by clicking here.