The SNP have been accused of "rank hypocrisy" as figures show Scottish Government agencies have given £18.5m to defence firms despite the party's criticism of the arms trade.

Scottish Green MSP John Finnie asked ministers how much public money had been used to support the arms trade in the past ten years.

In response to his parliamentary question, economy secretary Keith Brown revealed Scottish Enterprise had handed out £15.1m and Highlands and Islands Enterprise (HIE) £3.4m.

The money was given as direct financial support, investments, graduate placement schemes and advice services for the defence industry.

The Greens have said the support for the defence industry is "squandering vital funds."

Last year, the SNP hit out at the UK's record on arms trading as "atrocious" after it was reported weapons made in the UK were being sold to countries which use child soldiers.

The party also called for an end to arms sales to Saudi Arabia, a major export destination, due to concerns over civilian casualties in the civil war in Yemen.

It has been reported Saudi Arabia is using Paveway IV smart bombs in the conflict.

Defence firm Raytheon, which has a plant in Fife, makes laser guidance systems for the bombs.

Finnie said: "It is rank hypocrisy for SNP MPs to, as they have, condemn the sale of arms from the UK while at the same time the SNP Government is handing out millions of pounds of taxpayers' money to support that very industry.

"The scale of funding will shock many people, and I think the public will rightly be angry that public funds are being used to encourage such an abhorrent trade.

"By supporting the making and selling of guns and bombs our enterprise agencies are squandering vital funds. They must rethink their approach and invest instead in meaningful, lasting employment."

He added: "Scottish Government ministers must lead by example. Instead of praising bomb-makers they should face up to modern-day security challenges: conflict over resources, climate change, cybersecurity and terrorism.

"They should stop funding outdated and immoral businesses and focus efforts on peace and human security."

A Scottish Government spokesman said: "These claims misrepresent our position, which is that the use of military force should only be sanctioned by governments where it is lawful to do so and is in accordance with the principles of the UN Charter.

"We have raised repeated concerns over the misuse of weapons and support calls for the UK Government to investigate reports that British-made weapons have been used unlawfully against civilians in Yemen.

"The funding Scottish Enterprise have provided has supported companies in diversifying and in developing non-military applications for technology, as well as to secure employment opportunities in Scotland."

A spokeswoman for Scottish Enterprise said: "Scottish Enterprise has supported 24 companies over the past ten years in the defence industry.

"Of the £15.1m figure quoted in the Parliamentary Question, £12.1m was given to support Selex ES Ltd (now known as Leonardo UK) for the development of protective sensory and radar equipment, an area in which Scotland is considered a world leader."

A spokesman for HIE said: "We do not provide assistance directly to the arms trade. Our support in this context relates to activities by companies in related industries who may also target military contracts.

"These are mostly electronics and engineering firms primarily engaged in research and development or supply of components or products, some of which may be applicable for defence related use. Some of their clients therefore may include defence sector firms as well as oil and gas, nuclear or aerospace."