A man accused of preparing to commit acts of terrorism and suggesting online that he planned to attack the Fife Islamic Centre will stand trial next year.

Sam Imrie, 22, allegedly acquired knives, nunchucks, a hammer, a baseball bat, a rifle scope and petrol, which he referred to as his “arsenal”, between June 20 and July 4 this year.

He is accused of posting statements on the internet platform Telegram indicating he planned to stream live footage of an incident and posted statements suggesting he was going to carry out an attack on the Fife Islamic Centre in Glenrothes.

READ MORE: Man arrested over death of Mary McLaughlin in 1984

It is also alleged he recorded and compiled details of terrorist attacks on places of worship.

Imrie denied all the charges against him when he appeared at the High Court in Glasgow on Thursday.

It is alleged that, intending to commit acts of terrorism, he engaged in conduct in preparation at various places in Glenrothes and Markinch in Fife and elsewhere between June 20 and July 4.

Prosecutors claim he repeatedly tried to get into the Fife Islamic Centre and uploaded photographs and video footage of the centre to Telegram, and also set fire to property at Strathore Lodge in Thornton and St Drostan’s Cemetery in Markinch.

They allege he went to the Fife Islamic Centre in a car with a can of petrol, carried out observations there and made recordings of the centre and surrounding area on his phone.

It is alleged he also created and possessed Nazi, neo-Nazi, anti-Muslim, anti-Semitic and other racist or violent images; text and audio files plus a quantity of images that glorified terrorism, and that he was also in possession of texts by convicted terrorists Anders Breivik and Brenton Tarrant.

Imrie is also accused of publishing or causing another person to publish statements, images and video footage on Facebook and Telegram glorifying terrorist acts committed by others, making offensive comments about the Muslim and Jewish communities and uttering racial remarks with the intention of directly or indirectly encouraging the commission, preparation or instigation of acts of terrorism between June 22 2018 and July 4 2019.

It is alleged the offences were racially aggravated and were aggravated by religious prejudice.

Prosecutors also say Imrie collected information likely to be useful to a person committing or preparing an act of terrorism between June 20 and July 4 this year.

Imrie faces two charges under the Terrorism Act 2006 and one under the Terrorism Act 2000.

He is also accused of possessing “extreme pornographic images” depicting sexual activity involving a human corpse between June 28 and July 5 this year.

READ MORE: Scottish teenagers charged over high school bomb hoaxes in five countries

It is also alleged he took or permitted to be taken, or made, indecent photos or pseudo-photographs of children and that he was in possession of such photographs between June 15 and July 5 this year at an address in Glenrothes.

He is charged with driving while unfit through drink or drugs on July 4 this year.

Lord Turnbull set a trial date for June 1 next year at the High Court in Glasgow.