The abuse, which included the words “F*k off P***s”, was scrawled on the entrance gates of the Masjid-e-Salaam in Watling Street, Preston.
A photograph of the graffiti were posted on the mosque’s official Twitter account on Friday afternoon.
Another picture showed the gates after the graffiti was removed.
“Before and after,” the mosque twitter account wrote. “All cleaned up in readiness for the main Friday prayers.
“Our Mosque is open for all and do not harbour any evil for those who wish otherwise.”
Lancashire Constabulary investigators believe the offence took place at some point overnight between Thursday and Friday.
“Hate incidents and crimes of any kind are not acceptable,” said chief inspector Gary Crowe. “There is no place for hate in Lancashire. We are making a number of enquiries, including looking at CCTV, to find out who is responsible for this crime.
“We are maintaining contact with the mosque and patrols have been increased in the area. If you have any information or saw anything suspicious in the area last night or in the early hours of this morning, please come forward.”
Local Labour councillor Freddie Bailey, 22, said he was “absolutely disgusted” by the attack.
“Unfortunately last night someone graffitied the Mosque in the area I represent in Preston,” he tweeted. “There is NO excuse for this act of hate.”
The Muslim representative on the Preston City Council faith covenant, Mukhtar Master, described it as “an isolated racist incident.”
He said: “The Salaam Mosque, just as all other mosques in Preston, work tirelessly in trying to develop and maintain good relationships with all sections of our wonderful community.”
It follows a series of attacks on mosques in Birmingham last month, when windows were smashed at six buildings across the city.
The incidents prompted fear among local communities in the aftermath of the terror attacks on two mosques in Christchurch, New Zealand, in which 50 people were killed.