THE SNP has been accused of hypocrisy after a senior minister privately praised an arms manufacturer linked to the Saudi-led bombing of Yemen, and the party condemned the same war in public.

Files released under freedom of information show the then business minister Fergus Ewing visited the Glenrothes factory owned by US defence giant Raytheon last September, shortly after the plant was linked to civilian casualties in Yemen.

The Glenrothes site makes guidance systems for the 500lb Paveway IV bomb, which Saudi Arabia is reportedly dropping in Yemen.

Ewing’s “key messages” on the visit were to express “delight” at Raytheon’s support of government strategy, and “underline the Scottish Government’s support for Raytheon as a major employer in the Fife area”.

He also recognised the “vital role” the aerospace, defence and marine sector plays in Scotland’s economy, with the hope it would “grow and prosper”.

Ewing’s briefing note stated: “This government’s priority is to make sure that any company based in Scotland can compete in global markets.”

His briefing flagged up a 2014 press report about Paveway bombs being used in Gaza as a “potential sensitivity”, but he visited the plant regardless.

Opposition parties last night accused the SNP of hypocrisy for condemning the war in Yemen in public but cosying up to the bomb-maker behind closed doors.

A Saudi-led coalition began bombing the failed Gulf state in March 2015 after its government was overthrown by rebels sponsored by the Saudis' main regional rival, Iran.

Since then more than 3,000 civilians have died in a civil war dubbed Saudi Arabia’s Vietnam.

Last July, Britain authorised the transfer of around 2400 Paveway IV missiles from the RAF to Saudi Arabia in a £200m deal.

Shortly after Ewing’s visit to Glenrothes, the SNP at Westminster began condemning the war in Yemen.

In October, after a question from MP Patrick Grady, a foreign office minister admitted UK firms were “providing precision guided Paveway weapons” to the Saudi Air Force.

In January, SNP Westminster leader Angus Robertson challenged David Cameron at Prime Minister’s Questions about “British-made bombs” being dropped by the Saudis in Yemen.

And this March, Glenrothes MP Peter Grant used a Westminster debate on Yemen to refer to claims that “weapons or weapons components... some of which are manufactured by Raytheon in my constituency” were being used by Saudi Arabia.

The SNP also called last week for an end to “existing arms deals with Saudi Arabia”.

However files released to the Sunday Herald show that, behind the scenes, Ewing was full of praise for Raytheon in Glenrothes.

Ewing first visited the plant at Raytheon’s invitation in March 2012. The civil service briefing for the visit said his “key messages” should include “Congratulations to company for its innovative work”, and “Thanks for active commitment and support of the company in the development and implementation of the Scottish AD&M [Aerospace, Defence & Marine] industry Strategy.”

The overall aim was “to acknowledge Raytheon’s ongoing work and commitment to Scotland”.

The briefing said the manufacturing units at Glenrothes included “weapons systems” and the majority of the output was “geared towards the defence industry”.

However the plant, which employs around 560 people, is also trying to convert military technology into civilian spin-offs, the note said.

In March 2015, Ewing personally requested a second visit to the Glenrothes site, which took place place last September - six months after the bombing in Yemen began.

The visit was designed to “underline the Scottish Government’s support” for Raytheon. Raytheon boss Stephen Doran later wrote to Ewing saying the visit had been “a pleasure”.

Nicola Sturgeon promoted Ewing to her cabinet last week as the new Rural Affairs Secretary.

Green MSP John Finnie, who raised the Glenrothes plant during an SNP-led debate on Gaza last October at Holyrood, said: “The horrors we see happening in Yemen show how important it is that we stop the arms trade. The SNP in opposition at Westminster are right to challenge the UK Government on this issue but it’s hypocritical of them in government at Holyrood to be praising firms whose work is aiding such appalling acts of violence."

A Scottish Tory spokesman said: “This is a classic example of the SNP hypocrisy we’re so used to seeing. In public, it pretends to be outraged in a bid to appeal to its right-on socialist following. But in private, it’s happy to slap the back of anyone it thinks might be of value.”

An SNP spokesman said: “The only hypocrites are the Tories, who are trying to divert attention from serious questions they need to answer about safeguards over export controls.

"Raytheon Systems Limited is a major employer in Fife and is working with Scottish Enterprise and Scottish Development International, whose involvement is focused on diversification and commercialisation of products made in Glenrothes. Fergus Ewing's visit was in that context."