A burning bottle was hurled at a mosque while members were inside at evening prayers.
Thames Valley Police said a bottle containing flammable liquid was set alight and thrown on to the roof of the Zainabia Islamic Centre, commonly known as the Granby Mosque, in Bletchley at about 11.30pm last night.
The attack comes in the wake of the brutal murder of soldier Lee Rigby outside Woolwich Barracks in south-east London.
Members of the mosque in Peverel Drive quickly extinguished the fire, a police spokeswoman said.
There was no significant damage caused to the mosque during the arson attack, she added.
Police appealed for witnesses.
Detective inspector Nick Glister, from Thames Valley Police, added: "There were people inside the mosque at the time of the incident and this could have been far worse had it not been for the quick actions of the people who were standing outside the mosque at the time."
The BBC reported some 30 people were inside the mosque at the time of the attack.
Witness Fazilat Shivji told the BBC her husband saw "a streak of fire" while waiting for her outside the women's entrance of the mosque and shouted for them all to get out.
She told the broadcaster a similar attack had happened about a year ago. "We expect it at times of trouble," she said.
She told the BBC she was "sad and anxious" following the soldier's murder in Woolwich. "I think I am more scared now than at 9/11, which is surprising" she said.
"The vilification of Islam and Muslims is getting worse day by day and incidents like [Woolwich] don't help at all, but these are fringe elements," she said.
In a statement released by Thames Valley Police on their website, Shabir Sabur, president of Zainabia Islamic Centre, said: "Such acts committed by individuals or groups can never divide the nation. These criminals and terrorists must never be allowed to win, with all our communities and the nation united in our determination to fight off all forms of criminal and extreme behaviour and hate crimes, from whichever quarter it comes."
Local police area commander Barry Halliday said: "This is an extremely disgraceful and cowardly act which I condemn in the strongest possible terms.
"We have a multicultural and diverse community in Milton Keynes, who live and work together side by side, and we will not let a few misguided people divide us.
"I would like to ask the local community to remain vigilant and report any suspicious activity to the police right away by calling 101. Anyone with information about this incident should also call us and they will be dealt with in the strictest confidence.
"I would like reassure the community that we will do all we can to find the offenders and our neighbourhood teams will continue to patrol the area, so if anyone has any concerns they can speak to one of the officers."
Anyone with information should call Mr Glister from Force CID in Milton Keynes via the 24-hour Thames Valley Police inquiry line on 101.