A teacher who was caught viewing pornographic images on his computer while teaching a class has been struck off.

Computing teacher Neil MacFarlane was seen looking at an image of a naked woman after Greenfaulds High School's deputy head walked into his class and saw the picture on his PC monitor as pupils sat nearby.

He quickly minimised the window but he was confronted about the image and an investigation was held in October 2014.

Investigators found he had been viewing other inappropriate images and websites during school hours and had a diary with handwritten notes referring to pornographic magazines, as well as downloading pornographic images on to his computer.

At the General Teaching Council for Scotland (GTCS), Mr MacFarlane was banned from the classroom after being found "unfit to teach".

During a hearing which took place in April and May this year, a GTCS panel heard evidence from Suzanne Beattie, deputy head at the school in Cumbernauld, North Lanarkshire.

On October 24, 2014, she went in to Mr McFarlane's classroom to speak to a third year pupil.

The GTCS panel stated in its report: "As she entered the room, Mrs Beattie explained that she could see (Mr MacFarlane) sitting at his PC and on the screen was a full-sized nude picture of a female.

"The screen was facing (Mr MacFarlane) with the pupils sitting around the three walls.

"Mrs Beattie stated that anyone walking into the room would have seen the explicitly nude picture."

When she confronted him and asked "What did I just see?" he appeared "very flustered" and tried to explain it was an image from a film he had been watching.

While no pupils saw the image due to the way the monitor was placed, the GTCS said there was a risk the schoolchildren could have seen it or it could have been accidentally projected in front of the whole class on the whiteboard.

The computing teacher denied the charges but was not present at the GTCS hearing.

The panel rejected his explanation the pornographic images found on his computer had been placed there due to the automatic "synchronisation" feature of the file-sharing site Dropbox.

An expert told the panel that "human intervention" would have been required for the files to end up on his computer.

Announcing its decision to strike off Mr MacFarlane, the GTCS panel said: "(He) had placed pupils at risk of educational harm as he had not been appropriately engaged in teaching them when he was viewing the image on his screen.

"Furthermore, (his) extensive personal web use over a two day period demonstrated that he was not carrying out tasks relevant to teaching for significant periods over the school day."

He was also referred under the Protection of Vulnerable Groups scheme, which can ban adults from working with children.