HANAU, Germany - Hundreds of grieving people flocked to Friday prayers in the mosques of the German town of Hanau, two days after a racially motivated shooting shook the country and prompted fresh calls for a crackdown on far-right extremism.

Germany's top security official said authorities would step up the police presence throughout the country and keep a closer watch on mosques and other sites, in a first reaction to the rampage. In Hanau, German and Turkish flags flew at half-staff outside a mosque where worshipers were gathering Friday.

A 43-year-old German man fatally shot nine people with immigrant backgrounds in the Frankfurt suburb late Wednesday before apparently killing his 72-year-old mother and himself. Half of the victims were reported to be Turkish.

The man, identified as Tobias Rathjen, left a number of rambling texts and videos espousing racist views and claiming to have been under surveillance since birth.

More than 300 people attended prayers at the Turkish-speaking DITIB mosque attended by at least one of the victims. “The mood is subdued,” said Adam Arslan, who was friends with Gokhan Gultekin, who died in the attack. “I cannot accept this crime.”

“May our almighty God rest the souls of our brethren who lost their lives in Wednesday's heinous racist attack,” Fevzi Hoguk, the imam, or prayer leader, told the congregation.

Mosques opened their doors to journalists who have swarmed into Hanau after the attack - not the usual practice in privacy-obsessed Germany. A half-dozen TV cameras plus photographers and journalists mingled freely with the congregation before and after Friday prayers.

The chairman of the mosque board, Memduh Onder, said the community was not afraid, “because we are together,” citing the memorial gathering in front of city hall Thursday evening where German President Frank-Walter Steinmeier spoke. “The thousands of people on the square, most of them were German,” he said.

Meanwhile, officials confirmed they had received a letter from the suspect last November in which he sought help from authorities in stopping the surveillance he believed he was under. The letter didn't ring any alarm bells with prosecutors, officials said.

Interior Minister Horst Seehofer said state-level security officials and security agencies he consulted Thursday agreed to increase the law enforcement presence around the country. Seehofer said there would be more surveillance at “sensitive sites,” including mosques, and a high police presence at railway stations, airports and borders.

“The threat posed by far-right extremism, anti-Semitism and racism is very high in Germany,” Seehofer told reporters in Berlin.

Thousands of people gathered in cities across Germany on Thursday evening to hold vigils for the shooting victims but also to express anger that authorities haven't done enough to prevent attacks despite a string of incidents in recent years. Last week, authorities arrested 12 men - including a police employee - on suspicion of planning attacks on Muslims and politicians.

Some have also called for a crackdown on the extremist and anti-migrant ideology that has crept into mainstream political debate with the rise of the Alternative for Germany party, or AfD.

A top official in the centre-left Social Democratic Party, a junior partner in Chancellor Angela Merkel's governing coalition, accused AfD of providing ideological fodder to people like the Hanau shooter.

“One person carried out the shooting in Hanau, that's what it looks like, but there were many that supplied him with ammunition, and AfD definitely belongs to them,” Lars Klingbeil told German public broadcaster ARD on Friday.

Parts of Alternative for Germany already were under close scrutiny from Germany's domestic intelligence agency. The party has rejected all responsibility for far-right attacks, including an anti-Semitic attack on a synagogue and the killing of a regional politician last year.

One key question in the investigation is whether authorities or others were aware the suspect posed a threat.

“That's one of the points that's particularly interesting to me in this investigation,” said Seehofer. “Who knew what.”

Peter Frank, Germany's chief federal prosecutor, said the investigation would concentrate on the suspect's movements prior to the attack, and whether he had had contact with other people. The suspect's father was being questioned as a witness, he said.

Frank acknowledged that his office had received a letter from the suspect three months ago. The letter didn't contain many of the more explicit racist and genocidal comments later found in the document posted on Rathjen's website and didn't prompt any action from prosecutors, Frank said.

Seehofer noted that rules intended to ensure stricter background checks on gun owners came into force Thursday - a day after the attack - but that he was open to the idea of tightening the rules further.

One hurdle to effective communication between different branches of government in Germany is the country's treasured notion of privacy - which grew out of the experiences with the Nazi police state and communist East Germany - along with the complex web of local, regional, state and federal authorities that might be involved in checking a person's suitability for gun ownership.

“We will always respect data protection,” said Seehofer. “But the discussion about data protection mustn't push aside the discussion about security in this country.”

Jordans reported from Berlin.