A 26-year-old Ashland man was sentenced this morning in federal court in Boston to 17 years in prison for planning to crash explosives-laden model airplanes into the Pentagon and US Capitol and rigging cellphones to detonate improvised explosive devices to kill American troops.

Rezwan Ferdaus, who grew up in Massachusetts and has a physics degree from Northeastern University, began planning a holy war against the United States in 2010 after becoming convinced by seeing jihadi websites and videos that America is evil. He later approached a federal informant and met with undercover agents to discuss a plot.

Undercover FBI agents supplied Ferdaus, a US citizen, with money to buy the planes, explosives, three grenades, and six AK-47 assault rifles. He was arrested after he locked the explosives and guns in a Framingham storage facility he had rented. Authorities have said the public was never in danger from the arms.

Advertisement - Continue Reading Below

Ferdaus was facing a 35-year sentence, but under a plea agreement, federal prosecutors agreed to drop four of six charges and to jointly recommend with the defense a sentence of 17 years.

At 11 am, as Ferdaus walked into the US District Court courtroom, about a dozen family members and friends stood, waved at him and yelled, “We love you!” His mother, Anamaria, sitting in the front row, repeatedly instructed him “keep your head up.”

Ferdaus acknowledged his supporters, smiling widely and lifting his cuffed hands to wave back. The courtroom then fell silent, awaiting the entry of Judge Richard Stearns.

In an address to the court, Ferdaus made references to “inhumanity in other places’’ but he did not specify what he was referring to. He also did not make a direct mention of his Muslim faith or terrorism by Islamic fundamentalists.

Instead, he talked about his mindset as he faces 17 years behind bars.

“I can dream of a brighter future,’’ Ferdaus said at one point. “God willing, I will acclimate. I am in acceptance of my fate.’’

From the bench, Stearns seemed to have been moved by Ferdaus’s introspective statement, telling him “the statement convinces me you have the character and the capacity to search your own soul.’’

The judge also said he had received numerous letters of support from family and friends of Ferdaus, including a letter from his parents that contained photographs chronicling their son’s life.

The judge said the letter from Ferdaus’s parents was “a portrait of a much-loved son.’’ But the judge added, “I did notice there was a point in which his life turned darker.”

Ferdaus was charged in a six-count indictment with attempting to damage and destroy a federal building by means of an explosive, attempting to provide material support to terrorists, attempting to damage and destroy national defense premises, receipt of explosive materials, receipt of possession of non-registered firearms and attempting to provide material support to Al Qaeda. He pleaded guilty to the first two charges.

Prosecutors said Ferdaus planned to kill American soldiers in Iraq and Afghanistan using improvised explosive devices detonated by the modified cellphones. He also planned to blow up the Pentagon and US Capitol using remote-controlled planes measuring up to 80 inches in length and capable of speeds greater than 100 miles per hour. The planes would be guided by GPS and contain 5 pounds each of plastic explosives. He also planned to enlist otthers for a ground assault on the federal buildings.

Authorities have said the planes would likely not have done any major damage.

Ferdaus traveled to Washington, D.C., to scout out his targets and later gave the undercover agents surveillance photos and maps, prosecutors said. He was arrested in September 2011.