The FBI is investigating a suspicious package containing explosives left unattended by security guards for three weeks inside a 26-story federal building in Detroit, according to law enforcement officials.

The package, containing “explosive components,” is at the FBI crime lab in Quantico for further testing as a federal investigation continues, according to FBI Special Agent Sandra Berchtol.

The Patrick V. McNamara Federal Building in downtown Detroit houses regional offices for the FBI, IRS, Social Security Administration, Peace Corps and Sen. Carl Levin (D-Mich.).

The incident is the latest in a string of embarrassments for the Federal Protective Service, a tiny Department of Homeland Security agency employing a mix of government and private contract guards to protect more than 9,000 federal facilities nationwide, including the Detroit building.

A law enforcement source said a private security guard brought the suspicious package into the building, where it remained, unopened and unscreened, for about three weeks. The source, who spoke on the condition of anonymity because the investigation is ongoing, said guards thought the package might have belonged to someone on a construction crew working outside the building.

About three weeks later, security personnel decided to screen the package, became alarmed at the results, and called federal authorities and the Detroit police department’s bomb squad. “They weren’t sure what it was but thought it better to get it out of the building,’’ the source said. “That’s when everyone converged on the building.”

A private security guard involved in the incident has been suspended until further notice, according to a senior FPS official. Similar disciplinary action will be taken against contract and FPS-employed guards if the investigation determines others are culpable, the official said.

A spokeswoman for Levin said that he and his staff members have been briefed on the investigation and that he “is eager to learn the results of that investigation.”

The FPS employs about 800 federal inspectors who are responsible for overseeing more than 15,000 private security guards and for drafting building security plans.

The Government Accountability Office reported in 2009 that government investigators successfully smuggled bomb-making materials into 10 federal buildings protected by the FPS that house national security or law enforcement agencies. The GAO is conducting multiple investigations into the agency’s activities and is exploring potential alternatives to the FPS, according to a GAO official.

The FPS — once overseen by Immigration and Customs Enforcement and now managed by Homeland Security’s risk-reduction office — is deploying certified trainers to provide refresher courses to contract and FPS guards across the country, according to agency spokesman Chris Ortman. The training team is scheduled to meet with Detroit area guards in the coming days, he said.

Democratic lawmakers introduced legislation last fall that would require the FPS to establish national training standards, hire more federal inspectors and explore ways to federalize contract guards. Congressional aides said the legislation, which never made it out of House and Senate authorizing committees, is expected to be reintroduced by Sen. Joseph I. Lieberman (I-Conn.) before the April congressional recess.