An ultra-Orthodox Jewish man stabbed six gay pride marchers in Jerusalem Thursday — weeks after completing a 10-year sentence for knifing three people at the same event in 2005, authorities said.

Yishai Shlissel — released from prison just three weeks ago — had posted a message online about the “abomination” of a gay pride parade in the holy city.

A woman who was in a grocery store when the attack occurred described a chaotic scene.

“All of a sudden, somebody came in and screamed, ‘Somebody has a knife and is stabbing some people!’ ” Sharon Liebman, 51, told Agence France-Presse.

“I saw three people on the ground — two males and a female.”

Michael Rosner, 22, who was visiting the Israeli capital from London, said: “I saw the guy with the knife running. I saw the blood on the pavement.”

Hanoch Zelinge, a medic, said a woman was stabbed in the back, chest and neck.

Two of the most seriously injured — a man and woman both in their 20s — were taken to Jerusalem’s Shaarei Tzedek hospital.

Shlissel published a handwritten letter a week ago saying, “It is the obligation of every Jew to keep his soul from punishment and stop this giant desecration of God’s name next Thursday,” the Israeli Maariv newspaper reported.

Anti-gay protesters from the far-right group Lehava staged a demonstration at the parade, with members holding rainbow-colored banners reading, “Mum, where is Dad?” and “Dad, where is Mum?”

Meir David Koperschmidt of Lehava told the Jerusalem Post that the group was protesting because homosexuality “is a big prohibition in the Torah.”

Gay rights leader Oded Fried said the parade wasn’t canceled after the attack because “our struggle for equality only intensifies in the face of such events.”

Defiant and somber paradegoers decked with rainbow flags continued to march.

“I do think that homophobia is rooted in the city, but that’s the point of the parade,” said Benny Zupick, 21, one of the marchers.

“We are trying to change that. And, hopefully, we will change that. It takes one man to create a scene like this. Hopefully, he’s a minority.”

There was a “massive presence” of cops at the parade but, “unfortunately, the man managed to pull out a knife and attack,” said police spokesman Asi Ahroni.

A majority of the city’s residents are either observant Jews or Muslim or Christian Palestinians.

Israeli leaders — including Prime Minister Benjamin Netanyahu and President Reuven Rivlin — and ultra-Orthodox leaders condemned the attacks.

“People celebrating their freedom and expressing their identity were viciously stabbed,” Rivlin said. “We must not be deluded, a lack of tolerance will lead us to disaster. We cannot allow such crimes, and we must condemn those who commit and support them.”

Jerusalem’s annual pride parades are smaller than those in Tel Aviv, which is one of the world’s most gay-friendly cities.

The Jewish state repealed a ban on consensual same-sex sexual acts in 1988.

With Post Wire Services