One person in the mosque managed to overpower the gunman, suffering "minor injuries" in the process.
On Saturday, Norwegian media reported that the suspect was believed to have put up a post to an online forum hours before the attack where he seemingly praised the New Zealand assailant.
After he was arrested, a woman was found dead at his house.
"I suddenly heard shooting from outside", Mr Mohammad told Reuters via an interpreter, adding that a man then entered the building with guns and pistols.
The incident comes almost eight years after Norway's deadliest peacetime attack, when anti-Muslim neo-Nazi Anders Behring Breivik massacred 77 people at a camp. The police on Sunday said the woman was identified as the stepsister of the shooter.
The mosque had implemented extra security measures this year after the massacre of more than 50 people at two New Zealand mosques by a suspected right-wing extremist.
"One of our members has been shot by a white man with a helmet and uniform", Irfan Mushtaq, head of the mosque, told local newspaper Budstikka.
Mosque director said the victim is a 75-year-old member of the congregation.
The shooting is being investigated as a "possible act of terrorism", police said.
They said the alleged perpetrator is also a murder suspect in a separate case.
In the online post, references were made to a "race war" and it ended with the words "Valhalla awaits", a reference to the afterlife for those who have died in battle in Norse mythology.
The shooting at the mosque in an Oslo suburb occurred as Muslims around the world celebrate Eid al-Adha this weekend, one of the most important holidays of the Islamic calendar. He has not been named by authorities nor has the motive in the attack; he has been charged with murder and attempted murder.
The department said it was working with the Norwegian Police Security Service, Norway's national domestic security agency, since the "investigation has given us a better overall understanding of the attack" at the mosque.
Prime Minister Erna Solberg, who expressed sympathy after the attack, said in a statement: "This is not supposed to happen in Norway".