A 26-year-old physics graduate and model hobbyist from Massachusetts was arrested Wednesday in an FBI undercover operation and accused of planning to build small, explosive-laden drones to attack the Pentagon and the Capitol, according to an FBI affidavit and law enforcement officials.

Rezwan Ferdaus, a U.S.-born citizen of South Asian background, traveled to Washington last May to conduct surveillance and intended to launch three small GPS-guided aircraft from East Potomac Park — two against the Pentagon and one against the Capitol, according to a detailed plan he gave to the FBI.

The alleged attack would have represented a rare attempt to strike the United States with a technology that successive administrations have deployed against suspected terrorists and insurgents in a half-dozen countries, ranging from Afghanistan to Yemen, over the past decade.

When he was arrested in Framingham, Mass., Ferdaus had already acquired one remote-controlled aircraft, a small-scale model of the F-86 Sabre, a Cold War-era U.S. fighter jet, the FBI affidavit said. He was also planning to expand his attack to include an immediate follow-on assault at both sites with two three-man teams wielding automatic weapons, the FBI said.

In recent years, the FBI has increasingly relied on undercover operatives to build cases against suspected terrorists, an approach that officials say has been effective in preventing attacks. Undercover law enforcement operatives have secretly befriended those suspected of plotting terrorist attacks and, in some case, made available the means to carry them out. These methods have drawn criticism from some Muslims who accuse the government of unfairly targeting their community, and from defense lawyers who say such tactics can constitute entrapment.

The FBI undercover agents provided Ferdaus with the money to buy the drones, but law enforcement officials said Ferdaus came up with the idea for the attack. Prosecutors said Ferdaus “was presented with multiple opportunities to back out of his plan, including being told that his attack would likely kill women and children,” but that he “never wavered in his desire to carry out the attacks.”

A graduate of Northeastern University in Boston who lived in the basement of his parents’ home in Ashland, Mass., Ferdaus began planning to commit violent jihad against the United States in early 2010 after viewing radical Web sites and videos, the FBI said.

In a series of recorded conversations with a former felon who was cooperating with the FBI and two undercover agents, Ferdaus described Americans as the “enemies of Allah” and said he wanted to “decapitate” the U.S. government’s “military center,” according to the affidavit.

Ferdaus believed the undercover FBI agents were recruiters for al-Qaeda, and Ferdaus supplied them with seven mobile phones that he modified to act as electrical switches for improvised explosive devices in Iraq.

A law enforcement official said the devices could have worked as intended. “He had some capabilities,” said the official who spoke on condition of anonymity to discuss an ongoing case.

In a meeting with the FBI agents, Ferdaus “appeared gratified” when he was told, falsely, that the first phone was used in an attack that killed three U.S. soldiers in Iraq and and injured four or five others. After he handed over each successive phone, he wanted to know how the devices had performed, according to the affidavit.

Attempts to reach Ferdaus’s family in Ashland were unsuccessful.

Ferdaus had an initial appearance in federal court in Worcester, Mass., on Wednesday and is scheduled to have a detention hearing Monday.

“I want the public to understand that Mr. Ferdaus’s conduct, as alleged in the complaint, is not reflective of a particular culture, community or religion,”said Carmen M. Ortiz, the U.S. attorney for Massachusetts.

Rep. Peter T. King (R-N.Y.), chairman of the House Homeland Security Committee, said the case demonstrated a need for broad vigilance. “The fact that Ferdaus is a very well-educated physicist should serve as a reminder to us that the threat of Islamic terrorism transcends socioeconomics and does not only emanate from the poor and underprivileged.”

In January 2011, the FBI alleged, Ferdaus told the cooperating witness about his plans. “It’s a small, drone aircraft that would be programmed at that target . . .that can carry a good enough payload and it will detonate on impact,” Ferdaus said, according to the affidavit. At a separate meeting, Ferdaus showed the cooperating witness the “electrical components and remote-controlled cars that he built and said he “used to be into robotics.”

In March, the cooperating witness introduced Ferdaus to the two undercover agents who referred to Osama bin Laden as “our boss.” One of the agents is referred to in the affidavit as “Brother Hussein.”

Ferdaus told the agents that he been considering for some time using drones to stage an attack. Drones have been considered by other American militants. Christopher Paul, an Ohio native who joined al-Qaeda and pleaded guilty in 2008 to conspiracy, researched remote-controlled model helicopters and remote-controlled boats, according to law enforcement officials.

After his trip to Washington, Ferdaus presented the agents with a detailed plan, annotated with numerous pictures, on two thumb drives. The plan contained an introductory “abstract,” and various sections including “Hardware and Aircraft configuration” and “Software Overview.” The FBI described it as “extremely detailed” and “well-written.”

Ferdaus rented a storage facility in Framingham to build the drones. He was taking delivery there of C-4 explosive and AK-47 automatic weapons from the undercover officers when he was arrested.

Staff researcher Julie Tate contributed to this report.