By Noah Barkin and Thorsten Severin

BERLIN (Reuters) - Germany is planning to loosen restrictions that have prevented its intelligence agencies from monitoring radicalised teenagers after several attacks this year by young Islamic extremists exposed flaws in surveillance rules.

According to an amendment to an anti-terror law due to be voted on by parliament on Friday, the age of suspects that Germany's domestic intelligence agency is allowed to track and collect data on will be reduced from 16 to 14.

The move comes after a 15-year-old girl, identified by police as Safia S., nearly killed an officer in the Hanover train station in February by stabbing him in the neck with a kitchen knife.

Police have since acknowledged that they received numerous warnings about the girl's descent into radical Islam and also knew she had flown to Istanbul a month before the attack in an apparent attempt to cross into Syria and join Islamic State.

While there, prosecutors believe she met two Islamic State middlemen who convinced her to carry out a "martyr operation" upon her return to Germany.

Hans-Georg Maassen, head of Germany's domestic intelligence agency, the Federal Office for the Protection of the Constitution (BfV), has said the strict rules on monitoring minors contributed to the security failures in Hanover.

He has pushed publicly for a loosening of the rules and his calls began to resonate in Berlin after two 16-year-olds with ties to Germany's radical Salafist community attacked a Sikh temple in the city of Essen in April.

The loosening of the age rule is part of a package of tighter measures that the German government agreed following deadly attacks by Islamic militants in Brussels and Paris.

The new law would also increase police powers to deploy undercover agents, empower Germany's intelligence agencies to exchange information with foreign partners and require people who purchase pre-paid mobile phones to provide identification and a home address.

NAZIS, STASI, NSA

Scepticism towards surveillance runs deep in Germany because of the excesses of the Nazi Gestapo and East German Stasi secret police. More recently, revelations of widespread spying in Europe by the U.S. National Security Agency (NSA) have deepened suspicion of intelligence agencies in Germany.

Rights groups, which have criticized France's robust police crackdown following the Paris attacks, praise German restraint. They point to U.S. policies after 9/11, including the waterboarding and renditioning of terror suspects, as a lesson in how not to react to attacks.

Members of the opposition Greens and Left Party have warned against the dangers of tougher counter-terrorism laws but pressure has still grown to tighten surveillance rules.

Although Germany has not been the victim of a major attack by Islamist extremists, it was a transit country for militants who carried out the Paris and Brussels attacks, and intelligence agencies say there are signs that Islamic State may have planted fighters among the hundreds of thousands of migrants who arrived in the country in uncontrolled fashion last year.

Intelligence agencies and conservative politicians warn that tight restrictions on surveillance have left Germany out of step with the rest of Europe and at greater risk of attack.

"The heightened threat level has underscored the need to reduce hurdles for the German intelligence services, notably in the area of data retention where the law remains very restrictive compared to other European countries," Marian Wendt, a member of Chancellor Angela Merkel's conservatives who sits on the domestic affairs committee in the Bundestag, told Reuters.

(Additional reporting by Thorsten Severin; Editing by Richard Balmforth)