Barry Walter Bujol Jr. was also ordered to pay a $10,000 fine during his sentencing hearing before U.S. District Judge David Hittner.
Bujol was convicted in November on charges of attempting to provide material support to a foreign terrorist organization and aggravated identity theft.
"We do not take matters of potential national security lightly," U.S. Attorney Kenneth Magidson said in a statement. "This case and its successful resolution represents our commitment to making our communities a safer place to live."
Before his sentence was handed down, Bujol told Hittner he never wanted to hurt anyone. He also said prosecutors were wrong in portraying him as a terrorist.
"I'm a person, not a terrorist," he said in a brief statement, adding that he had made some mistakes.
Bujol's attorney, Daphne Silverman, had asked for a sentence of seven years, telling Hittner that her client was not dangerous.
"He's an incredibly strong and peaceful person," she said.
But prosecutor Stephen McIntyre told Hittner that Bujol, in coded messages sent to people he believed were members of al-Qaida, advocated the destruction of U.S. drones and the murder of American soldiers.
"The defendant talked about his desire to live and die with the brothers (members of al-Qaida)," McIntyre said.
Hittner sentenced Bujol to 15 years for the charge related to trying to provide help to a terrorist group and five years for identity theft. The judge ordered the sentences be served consecutively.
Prosecutors said Bujol, a U.S. citizen, sought to join al-Qaida and provide it with money, two nonpublic restricted-access Army manuals related to U.S. drones and GPS equipment. He was arrested in May 2010 following a two-year investigation after he used fake identification to sneak into a Houston port and board a ship bound for the Middle East.
The 31-year-old said he never intended to harm the United States or any American citizens, and that he had wanted to leave the country was because he was displeased with U.S. foreign policy, particularly drone attacks. He said he wanted to become a better Muslim.
"We are using drones to murder and attack people," Silverman told Hittner. "It was a valid position (Bujol) was taking ... to disapprove of drones. That's what his concern was, defending people and not hurting people."
Authorities used an undercover informant who befriended Bujol and, posing as a recruiter for al-Qaida in the Arabian Peninsula, offered to help him travel to the Middle East. The informant wasn't a law enforcement agent.
Authorities said Bujol made three unsuccessful attempts in 2009 to travel to the Middle East.
Prosecutors also alleged Bujol exchanged emails with the U.S.-born cleric, Anwar al-Awlaki, who had ties to al-Qaida.
Al-Awlaki, killed by a U.S. drone strike in September in Yemen, is also believed to have exchanged emails with Maj. Nidal Hasan, the Army psychiatrist charged in the killing of 13 people in the November 2009 shootings at Fort Hood in Texas.
Silverman said Bujol had a very brief email exchange with al-Awlaki, but that was before the cleric was known to have ties to terrorism and Bujol only sought spiritual advice. She also said the informant led Bujol led astray.
According to court documents, Bujol used at least 14 email addresses to hide his activities from authorities, and he advocated attacking U.S. facilities where military weapons were manufactured.
Bujol, who lived in Hempstead, about 50 miles northwest of Houston, was a student at nearby Prairie View A&M University.
Tariq Ahmed, an attorney with the Muslim Civil Liberties Union, which also worked on Bujol's case, said many Muslims in Houston were afraid to speak out on Bujol's behalf because they didn't want to be associated with a terror-related case.