He was arrested on Saturday after entering a mosque in an Oslo suburb, where three men were preparing for Sunday’s Eid al-Adha Muslim celebrations.
Police said he was waving weapons and several shots were fired but did not specify what type of weapon was used.
The court jailed Manshaus in pre-trial detention for four weeks.
One person was slightly injured before people inside the Al-Noor Islamic Centre held the suspect down until police arrived on the scene.
Police then raided Manshaus’s nearby house and found the body of his 17-year-old stepsister.
He is also suspected in her killing, police said, but did not provide details.
The head of Norway’s domestic security agency said on Monday officials had received a “vague” tip a year ago about the suspect, but it was not sufficient to act because officials had no information about any “concrete plans” of attack.
The suspect’s lawyer declined to comment on Norwegian media reports that Manshaus was inspired by shootings in March in New Zealand, where a gunman killed 51 people, and on August 3 in El Paso, Texas, which left at least 22 dead.