He hated his homeland.

The ax-swinging madman who launched a “terrorist attack” on four rookie NYPD cops on a Queens street was a Muslim convert who took to the Web to urge violence against America.

“America’s military is strong abroad, but they have never faced an internal mass revolt,” Zale Thompson, 32, wrote on Facebook. “They are weaker at home. We are scattered and decentralized, we can use this as an advantage.”

“Helicopters, big military will be useless on their own soil. They will not be able to defeat our people if we use guerilla warfare. Attack their weak flanks . . . If you get wounded who cares. If you die who cares. Eventually they will surrender and then the war will be over.”

Thompson — who was shot dead by police on Thursday after wounding two cops with a hatchet on a busy Jamaica street — even ­defended ISIS in a comment posted on a YouTube video and directed at another user who had blasted the militant group’s bloodlust.

“If you’re looking for ‘perfect’ Muslims who never make any mistakes in their Jihad, then you will be looking in vain! If the Zionists and the Crusaders had never invaded and colonized the Islamic lands ­after WW1, then there would be no need for Jihad! Which is better, to sit around and do nothing, or to ­Jihad?” he wrote.

The college-educated recluse was booted from the Navy in 2003 for drugs and spent most of his time holed up in his father’s Queens apartment watching violent jihadi imagery, NYPD Commissioner Bill Bratton said Friday.

Thompson became Muslim two years ago but ramped up his anti-American sentiment “with more intensity in recent days,” NYPD spokesman John Miller said.

Thompson repeatedly watched ISIS beheading videos, reports on the recent White House security breach and the deadly terror assault in Ottawa, Canada.

His Facebook page features an image of a Muslim warrior with a turban and sword that was taken from the cover of a book on Islamic culture in the Iberian Peninsula ­titled “Golden Age of the Moor.”

Drawn to their fiery rhetoric, Thompson also viewed propaganda and recruitment videos from ISIS, al Qaeda and al-Shabaab.

“It appears that this is something he has been thinking about for some time,” Miller said.

Investigators recovered another ax and a hunting knife at Thompson’s apartment, cops said.

Despite his thirst for jihadist content, cops said Thompson — who had domestic-violence busts in California but a clean record in New York — never joined a formal terror group or regularly attended a mosque.

“We would describe him as self-radicalized,” Bratton said.

Thompson’s extremism culminated in Thursday’s bloody attack in Jamaica, where surveillance footage shows him lurking in the area for several minutes before striking.

“He’s looking in their direction for a good two minutes, maybe longer,” a law-enforcement source said.

“You can see him standing on the corner. He appears to be looking toward where the police officers are. He removes the hatchet from his backpack. Then, all of a sudden, he just springs into action and goes right at these officers.”

The attack lasted seven seconds until Thompson was shot dead by two cops who had avoided the ax.

Thompson lunged at the four cops as they posed for a picture.

He chopped Officer Kenneth Healey in the back of the head and sliced Officer Joseph Meeker on the arm.

Surrounded by friends and family, Healey remained in critical but stable condition at Jamaica Hospital, cops said.

Meeker was released Friday, sources said.

LaToya James, 29, a homeless woman who worked at a nearby 99-cent store, was struck by a stray police bullet during the chaos and might be paralyzed, law-enforcement sources said.

Neighbors described Thomas as a quiet man who had become increasingly detached and depressed in recent weeks.

“He looked sad and was always alone,” said neighbor Herbie ­Villier.

Additional reporting by Jamie ­Schram and Georgett Roberts



Video: Devon McCarthy