A courtroom sketch of Zarein Ahmedzay, right, with his attorney Michael Marinaccio in Brooklyn federal court in New York. Photo: AP

A city cab driver who the feds claim plotted with a self-confessed al-Qaeda terrorist to unleash an attack on the subway system pleaded guilty today to terrorism charges — then went on a rant against “Zionist Jews” for trying to destroy this country.

Zarein Ahmedzay appeared in Brooklyn federal court and told a judge that he received orders from al-Qaeda leaders to carry out the botched plot last September to bomb several Manhattan subway lines.

“Your honor, I strongly urge the American people to stop supporting the war against Islam. It would be in their interest,” warned Ahmedzay. “I am thankful for myself that I did not do anything to harm anyone, but I fear someone else might.”

Ahmedzay, 25, pleaded guilty to conspiracy to use weapons of mass destruction and providing material support to al-Qaeda. He faces life in prison when he is sentenced July 30.

The feds said he joined admitted terrorist Najibullah Zazi and another pal from their Queens high school on a trip to Pakistan two years ago to seek terrorism training.

The bombings were planned for just a few days after the eighth anniversary of the Sept. 11 attacks.

Zazi, an airport van driver, admitted earlier this year that he tested homemade bomb-making materials in a Denver suburb before driving to New York with the goal of attacking the subways to avenge US military involvement in Afghanistan.

During his court appearance, Ahmedzay continued his tirade, saying the “real enemy of this country are the ones destroying the country from within … I believe it’s a special group, Zionist Jews, who want a permanent shadow government.”

During the hearing, prosecutors revealed that two al-Qaeda leaders who met with Zazi and his cohorts in Pakistan were Saleh al-Somali and Rashid Rauf, who both died in US air strikes over the past year.

“During the summer of 2008 we went to Afghanistan to wage jihad against American occupiers and the corrupt Karzai government to establish the perfect justice of Allah,” said Ahmedzay. “We were prepared to kill the occupying forces, including United States military. … [al-Somali and Rauf] spoke English very well. We told these individuals that we wanted to wage jihad in Afghanistan.”

Ahmedzay and the third suspect, Adis Medunjanin, had previously pleaded not guilty to charges they sought to join Zazi.

“The three of us decided to continue with the suicide bombing during the month of Ramadan,” he said.

Zazi handed over the detonator and the bomb – a combination of acetone and hydrogen peroxide.

When Zazi caught a whiff of the FBI surveillance, he and Medunjanin were told that the plot was off.

Federal prosecutors said the men had modeled the attacks after the London transit bombings of July 2005 that killed 52 people.

“I personally believed that conducting an operation in the United States would be the best way to end the wars [in Iraq and Afghanistan]. … They decided we would be more useful in New York. I was familiar with the city as I was a New York City taxi driver. I knew the city very well. The most important thing was it hit well known critical structures to maximize the damage and casualties.”

An Afghanistan-born imam linked to the suspects recently pleaded guilty to lying to the FBI when asked about the men. He was sentenced to time served and ordered to leave the United States.