ST. LOUIS -- Two St. Louis men were ordered Thursday to spend seven years in federal prison for planning a foiled bomb attack targeting the Ferguson police chief, the county's prosecutor and other officials after last year's police shooting death of Michael Brown.

The sentences for Brandon Orlando Baldwin, 24, and Olajuwon Davis, 23 - identified by federal agents as New Black Panther Party members - mirrored those agreed upon by the men when they pleaded guilty in June to four felony counts, including conspiring to use explosives and making false written statements while buying firearms.

Their November arrests during a federal sting operation came just days before St. Louis County Prosecuting Attorney Robert McCulloch announced that a grand jury wouldn't indict Ferguson officer Darren Wilson in the August shooting death of the 18-year-old Brown, who was unarmed.

Get Breaking News Delivered to Your Inbox

Davis and Baldwin later admitted in court that they plotted to obtain explosives they planned to unleash upon McCulloch, then-Ferguson Police Chief Thomas Jackson, an unspecified area police station and an armored vehicle police used in controlling Ferguson protests.

Davis and Baldwin were taken into custody after buying three pipe bombs for $150, unaware the devices weren't functional and the seller during the nighttime meeting at an industrial park was a federal agent.

No explosives were ever detonated, and none of the would-be targets were harmed.

"The disruption of this plot, coming as it did on the eve of the expected grand jury announcement, undoubtedly saved lives. Luckily for all of us, we'll never know just how many," Richard Callahan, eastern Missouri's U.S. attorney, said in a statement after Thursday's sentencing hearings.

In court Thursday, after being described by defense attorney Kevin Lynch as "remarkably intelligent," a self-proclaimed philosopher and "artsy fellow," Davis apologized, telling U.S. District Judge Henry Autrey his "reckless, irresponsible and stupid" misdeeds were not reflective of him as a married father of three.

When asked by Autrey if he cared to address the court before being sentenced, Baldwin declined. Baldwin's attorney, Brian Witherspoon, had said his client stood by his letter to the judge, apologizing for Baldwin's "stupidity, as he put it."

Brown's death led to riots and protests in predominantly black Ferguson that soon spread elsewhere in the St. Louis region and beyond, spurring on a national "Black Lives Matter" movement seeking changes in how police deal with minorities. Those protests were rekindled with McCulloch's announcement that a grand jury his office convened opted against indicting Wilson in Brown's death, setting off a night of looting and arson fires in and near Ferguson.

The New Black Panthers initially had called the claims in the indictment against Davis and Baldwin "totally unfounded," and a statement from the organization said it tells members to avoid violence "unless in imminent danger according to the rules of self-defense."

Baldwin has told the judge his education included two years of college studies of criminal and juvenile justice, while Davis said he spent three years at the University of Missouri at Kansas City majoring in economics.