Police are appealing for information after "Muslims will perish by JC" was daubed at the Fife Islamic Centre in Kirkcaldy.
Several cars were also damaged by red paint.
Mohammed Aslan, the chairman of the centre, said: "This is the first time that anything like this has happened to us in the more than five years that we have been in Kirkcaldy and hopefully it won't happen again.
"It is not very nice and will cost hundreds of pounds to fix."
Kirkcaldy Area chief inspector Gordon Mitchell said: "This is a terrible crime and I appeal to anyone who has any information about it to contact Police Scotland on 101 or Crimestoppers on 0800 555 111.
"People can also speak to officers who are patrolling the area.
"Police Scotland treats all hate crime with the upmost seriousness.
"I encourage anyone who is the victim of a hate crime to contact us so we can deal with it as swiftly as possible."
A number of recent attacks on mosques in the UK have been linked to the alleged murder of Drummer Lee Rigby by two Muslim extremists in London, but police are unaware of the motivation behind this case.
Meanwhile, Prime Minister David Cameron has announced Friday's funeral of Mr Rigby would be a "very fitting service".