The first mosque in the Outer Hebrides has opened before the start of the Islamic holy month of Ramadan next week, after a herculean effort by supporters in the UK and worldwide.

Members of the tiny Muslim population of Stornoway on the Isle of Lewis invited local people of all faiths and none to celebrate the mosque’s opening after Friday prayers. Food set out on tables included celebratory cakes provided by the Hebridean Biscuit Company and a box of samosas sent from Leeds.

Aihtsham Rashid, a builder from Leeds who spearheaded a crowdfunding appeal and organised contractors and tradesmen to build the mosque, said it was a historic day.

“I’m overwhelmed and very, very emotional,” he said. “People have come from all over the island to be here today. The local community is over the moon.”

The derelict building that houses the mosque was renovated in just a few weeks after thousands of pounds was raised, mainly in small donations from around the world.

The mosque has separate areas for men and women to worship, space for meetings, and a small mortuary for preparing bodies for burial.

Stornoway’s Muslim population comprises a few dozen people, their number bolstered in the past couple of years by the arrival of a small number of Syrian families fleeing the civil war.

Muslims have lived on the Isle of Lewis since the 1950s, some working as travelling salespeople. Without a mosque, prayers were held in people’s living rooms or rented halls, and the bodies of the dead were washed in garages. It could be several days before an imam could come from the mainland to say funeral prayers.

After the community bought the derelict building in Stornoway, planning permission to turn it into a mosque was granted last summer. But progress was slow until Rashid intervened, using his construction industry contacts in Leeds to bring in expertise and materials.

People on the island have been mostly supportive of the project, although one breakaway Christian sect said it was a “most unwelcome development” and denounced Islam in general.

Ramadan is expected to begin on Tuesday or Wednesday. Muslims fast between dawn and sunset during the holy month, which is immediately followed by the festival of Eid al-Fitr.