A suspected gunman accused of an attempted terrorist attack on a Norwegian mosque and separately killing his teenage stepsister has appeared in court looking bruised and scratched, but smiling.

The suspect did not speak, and his defence lawyer Unni Fries told reporters he “will use his right not to explain himself for now”.

Philip Manshaus, 21, was arrested on Saturday after entering a mosque in Baerum, 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.

Norway Mosque Shooting
Flowers are left by a police cordon outside Al-Noor Islamic Centre Mosque in Baerum, Norway (Orn E. Borgen/AP)

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.

Hans Sverre Sjoevold, head of Norway’s PST agency, told a news conference that the agency and the police receive many tips from worried people every day and the information “didn’t go in the direction of an imminent terror planning”.

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.

Norway Mosque Shooting
Suspected gunman Philip Manshaus, left and his lawyer Unni Fries (Cornelius Poppe/AP)

The suspect smiled as he appeared in court on Monday with dark bruises under both eyes and scratches across his face and neck.

Police had said that he was prepared to cause deaths and more injuries but did not succeed because people inside the mosque helped neutralise him.

Dagbladet, one of Norway largest newspapers, reported that on day of the attack, Manshaus wrote online he had been “chosen” by “Saint (Brenton) Tarrant”, the Christchurch gunman.

The name of the Oslo mosque is similar to the one in the New Zealand attacks.

Prosecutors want him held on terror charges for four weeks.

Norway’s prime minister Erna Solberg called the attempted attack a “direct attack on Norwegian Muslims”.

The suspect’s thwarted plans recall those of the Norwegian right-wing extremist who in 2011 killed 77 people in 2011.

Anders Behring Breivik is serving a 21-year prison sentence for carrying out a terror attack.

Breivik had ranted about Europe being overrun by Muslim immigrants and blamed left-wing political forces for making the continent multicultural.

According to official figures, almost 4% of Norway’s 5.3 million are refugees, and roughly 12% of the population consists of immigrants or children of immigrants.