A Pakistani man convicted of agreeing to help an Al Qaeda operative with terrorist plans sneak into the United States was sentenced Thursday to 30 years in federal prison.

Judge Sidney H. Stein said Uzair Paracha knew what he was doing when he agreed to help a former Baltimore resident trying to sneak back into the U.S. from Pakistan.

The government said Majid Khan plotted with top Al Qaeda leaders to bomb underground storage tanks in gas stations in Maryland, and enlisted Paracha to pose as Khan so he could obtain immigration documents necessary for Khan to re-enter America. Khan never made it back to the U.S. and the attack never took place.

The judge said a stiff sentence was needed to deter such activity. "Other people need to understand you cannot assist terrorist organizations against the United States," he said.

Click here to visit FOXNews.com's Homeland Security Center.

Click here to visit FOXNews.com's War on Terror Center.

Click here to visit FOXNews.com's Law Center.

Paracha, 26, waved and smiled to his family as he entered and left court.

His lawyer, Edward Wilford, told the judge his client was "someone who was used rather than a saber-rattler leading the charge for Al Qaeda."

Paracha was convicted in November of providing material support to a terrorist organization after a trial in which prosecutors relied largely on his confession to FBI agents.

Paracha had told the FBI he had no personal interest in Al Qaeda but cooperated because Khan and others related to the terrorist network had promised to invest $200,000 in one of his family's businesses.

Paracha testified that he told investigators "what I thought they wanted to hear" during 72 hours of questioning after he was detained in 2003.

His father, Saifullah Paracha, is being held as an enemy combatant at Guantanamo Bay, Cuba. He has denied involvement in terrorism, though documents indicate he is suspected of laundering money for terrorists and associating with Al Qaeda figures.

Khan was one of a number of terror suspects seized by the U.S. government and presumed to still be held in overseas jails.