She visited the mosque at the Islamic Community Centre in Scunthorpe, north Lincolnshire - one of five in the town.
Wearing a lime-green outfit and matching hat, the Queen took off her black leather shoes and put on a pair of skin-coloured slippers on a visit to the prayer room.
"This is aligned to Mecca?" she asked, referring to the prayer-mat pattern woven into the carpet.
Later, after unveiling a plaque commemorating her visit, she was presented with a copy of the Koran - in Arabic and English - which she passed to an aide.
Jawaid Ishaq, the chairman of South Humberside Racial Equality Council, said: "It is a great honour for the people of Lincolnshire and the 3.5m Muslims living in England to have the Queen visit.
"After 11 September, the media created a myth about Muslims as terrorists, so when we got approval from the palace for the visit, it was a dream come true."
Windows at the mosque were smashed and "Kill Muslims" slogans were daubed on walls after the terrorist attacks in America.
The Queen will travel to Leicester and the Sikh Gurdhwara temple on Thursday, further recognising the multi-faith nature of multicultural Britain.
Ice gala
She went to a Hindu temple in London earlier this year and visited a Jewish museum in Manchester last week.
As part of her latest tour, the Queen also visited Lindsey Lodge Hospice in Scunthorpe, after arriving at the town's station on the royal train, accompanied by the Duke of Edinburgh.
Before leaving, the Queen was presented with a gift of Lincolnshire sausages.
Later, the royal couple were also visiting Nottingham where the Queen was to officially open the National Ice Centre.