Police say a gunman opened fire on the Al-Noor Islamic Centre, in the outskirts of the capital Oslo.
Later a woman was found dead at the house of the suspect, police said.
The suspect "is around 20 years old, a Norwegian citizen from the area," said assistant chief of police Rune Skjold, adding that the man was now suspected of murdering a relative.
"We consider this a suspicious death... The dead person is related to the man arrested earlier today," he said.
Police say the man acted alone when he attacked the mosque.