A California man's long battle to overturn his high-profile terrorism conviction faces a key courtroom test on Wednesday.

Lawyers for Hamid Hayat will argue that their client's trial attorney was incompetent, failing to uncover evidence they say proves his innocence. Federal prosecutors argue in court papers that they provided ample evidence of Hayat's guilt during the 2007 trial that the former Lodi cherry packer attended terror-training camps in Pakistan and returned to the United States with plans to launch an attack

A federal magistrate judge in Redding, California, is presiding over the hearing and will recommend to a district court judge whether Hayat's terrorism conviction and 24-year prison sentence should be tossed out.

Hayat was arrested along with his father and four other men connected to a Lodi mosque that federal investigators said served as the center of a Central California terrorist "sleeper cell." The 2005 raid generated national attention and raised concerns of a home-grown al-Qaida networks hiding in the country's heartland.

The high-profile investigation and prosecution started with a paid informant's now-discredited claims that he saw high-ranking al-Qaida officials attend a Lodi mosque in the late 1990s. After the Sept. 11, 2001, terrorist attacks, the FBI paid the informant $230,000 over three years to infiltrate the mosque and record conversations with imams and worshippers.

But in the end, only Hayat was convicted of terrorism in 2007. His father pleaded guilty to lying on his passport and served a brief jail sentence. The three other men were never charged with a crime, but they were deported.

A divided federal appeals court in 2013 upheld Hayat's conviction, saying he was given a fair trial. Now, Hayat's attorneys argue that he received incompetent legal counsel during his trial.

Hayat, now 31, confessed to FBI agents that he attended terrorist training camps in Pakistan and returned to the United States to await orders to carry out an attack. Hayat's appellate attorneys, led by appellate specialist Dennis Riordan, said the confession was ambiguous and coerced from a tired, hungry and ill Hayat after enduring hours of interrogation.

Furthermore, Riordan argue that Hayat's trial attorney failed to closely investigate the government's claims that Hayat attended Pakistani terrorism-training camps. Riordan argues that at least one camp Hayat allegedly attended was closed by the time Hayat arrived in Pakistan for lengthy visit with family. Riordan contends that Hayat's trial attorney, Wazhma Mojaddidi, should have sent a private investigator to Pakistan to talk to Hayat's family, who would have testified that Hayat never attended a camp.

Riordan said Mojaddidi was a recent law school graduate handling her first criminal case when Hayat's family hired largely because she spoke fluent Urdu, Hayat's native tongue. Mojaddidi declined comment other than to say that she supported Hayat's attempts to overturn his conviction.

Federal prosecutors counter in court papers that Hayat received a fair trial and that the evidence overwhelmingly showed he attended terror-training camps and planned U.S.-based attacks. They played recordings made by the FBI's informant of Hayat discussing his hatred of the United States and plan to attend training camps. Investigators also found literature in Hayat's apartment espousing pro-jihadist views.

"Hayat's chosen counsel provided him with independent, zealous, and competent representation," federal prosecutor Andre Espinosa wrote in court papers. "Moreover, any purported deficiencies did not legally affect his representation or prejudice him."