BERLIN (Reuters) - Germany is failing to deal with a surge in hate crimes such as attacks on asylum homes and there are signs "institutional racism" is a problem among law enforcement agencies, an Amnesty International report said on Thursday.

The human rights group said that even before the influx of more than a million migrants to Germany last year, authorities had not adequately investigated, prosecuted or sentenced people for racist crimes.

It pointed to the discovery in 2011 of a small neo-Nazi cell, the National Socialist Underground (NSU), which murdered nine immigrants and a policewoman between 2000 and 2007.

"With hate crimes on the rise in Germany, long-standing and well-documented shortcomings in the response of law enforcement agencies to racist violence must be addressed," Amnesty researcher Marco Perolini said.

Justice Minister Heiko Maas said his ministry would carefully evaluate Amnesty's report and examine whether action needed to be taken.

"One thing is clear - a state under the rule of law can never accept racist violence. We need to do everything we can to quickly catch the perpetrators and rigorously punish them," he said in an emailed statement.

After a 19-month inquiry into the NSU, a parliamentary committee said a combination of bungled investigations and prejudice enabled the NSU to go undetected for more than a decade.

The Amnesty report said Germany should set up an independent public inquiry to look over the NSU investigations as well as how Germany classifies and investigates hate crimes.

It said part of the problem was that there was a high bar on considering a crime racist in Germany and treating it as such.

Attacks on asylum shelters surged to 1,031 in 2015, up from 199 in the prior year and 69 in 2013, data from the Interior Ministry shows. Interior Minister Thomas de Maiziere has said the number is likely to rise again this year, with 347 such attacks registered in the first quarter of 2016 alone.

While refugees who arrived in Munich last September were applauded and handed sweets, the mood has since soured, with concerns about integration and security rife, and support for the anti-immigrant Alternative for Germany (AfD) rising.

About six anti-refugee protests took place every week in 2015, Amnesty International said.

(Reporting by Michelle Martin; Editing by Louise Ireland)