An anti-gay Orthodox Jewish extremist stabbed and injured six participants of an annual gay pride march Thursday in Jerusalem, police and witnesses said.

Police and medics said the assailant had wounded six people. Two were taken to hospital in serious condition.

Yishai Schlissel was arrested at the scene, according to police spokeswoman Luba Samri. Police said Schlissel was released from prison three weeks ago after serving a sentence for stabbing several people at a 2005 pride parade in Jerusalem.

Five thousand marchers waving banners were heading down an avenue when an ultra-Orthodox man jumped into the crowd and started stabbing people, witnesses said.

"I saw an ultra-Orthodox youth stabbing everyone in his way," said Shai Aviyor, a witness interviewed on Israel's Channel 2 television.

"We heard people screaming, everyone ran for cover and there were bloodied people on the ground," Aviyor said.

Media reports said the suspect hid in a nearby supermarket and jumped out to attack the march as it passed.

The suspect, who is reportedly the same person behind the 2005 pride attack, is seen hiding his weapon before six people were stabbed despite a 'massive presence' of police security. (Sebastian Scheiner/AP)

Police spokesman Asi Ahroni said there was a "massive presence" of police securing the parade but "unfortunately, the man managed to pull out a knife and attack."

The march continued after the wounded were taken for treatment, but in a more somber atmosphere. Media reported that thousands of Jerusalem residents who had not participated in the parade joined the march in solidarity after the attack.

A 'despicable hate crime'

Oded Fried, the head of a leading gay rights group, said the march would go on despite the attack.

"Our struggle for equality only intensifies in the face of such events," he said.

Israeli Prime Minister Benjamin Netanyahu called the attack a "despicable hate crime," describing it as a "most serious incident." It was the worst attack on the pride march in several years in the city where the religious population is more prominent than in other parts of Israel.

Netanyahu said Israel would prosecute those responsible to the full extent of the law, adding: "Freedom of individual choice is a basic value in Israel."

The parade, which attracts thousands of participants, has long been a focus of tension between Israel's predominantly secular majority and the ultra-Orthodox Jewish minority, who object to public displays of homosexuality.