Baby Yoda was going undercover.

The mission: be an unassuming toy that had just been stolen. But Baby Yoda would, in fact, be secretly helping Seattle police bust a store owner they suspected of orchestrating a band of “prolific shoplifters” and trafficking in thousands of dollars’ worth of stolen Legos.

The trick worked, police said. An undercover detective sold a 1,073-piece Lego set of The Child — a character commonly known as Baby Yoda in the Star Wars series “The Mandalorian” — to the owner of Rummage Around, a secondhand store in Seattle’s Pike Place Market, after telling him it was stolen, according to the Seattle Police Department.

Police arrested the store owner — 67-year-old Mark Steven Brady — and prosecutors have charged him with first-degree trafficking in stolen property, a felony. Police accuse Brady of running a network of shoplifters by telling them the kinds of items he would buy and sending them off, knowing they would steal them. They say he purchased thousands of dollars’ worth of stolen goods from July to September, including Star Wars Lego sets, Amazon electronics and a Philips Norelco hair trimmer.

Brady “was most likely directing … prolific shoplifters to steal property from retail stores for his own benefit of buying them at extremely low prices and reselling them to others,” Seattle police said in their investigative report.

Brady was released from jail earlier this week and, while running his store Thursday night, he told The Washington Post that he has never knowingly bought stolen goods. He said he plans to retain a lawyer and that some fellow Pike Place Market business owners have pledged to raise money on GoFundMe so he can do so.

“I do want to fight this,” he said.

The case against Brady started in July when security employees of an Amazon 4-star, a brick-and-mortar department store owned by the online retail giant, contacted police about a slew of thefts that had been plaguing them, the investigative report said. Repeat shoplifters had been raiding their shelves of expensive goods, they told police, claiming the thieves would come in, go straight to their targets and leave “comfortably enough to not even conceal them.” One, whom they identified as a 32-year-old man, stole more than $10,000 worth of merchandise, much of it Star Wars Lego sets, tending to gravitate toward ones from “The Mandalorian,” the report states.

In early September, police caught a break in the case. An Amazon 4-star employee checking out a secondhand store in Pike Place Market spotted items for sale and suspected they’d been stolen from their store. A security employee followed up the next day, went to Rummage Around and reported to police that “they 100 percent have our stuff.” The employee said some of the items on sale still had the unique radio frequency identification (RFID) tags Amazon had placed on them. (Jeff Bezos, founder of Amazon, owns The Washington Post.)

A detective went to Rummage Around about two weeks later. While inside, the detective saw one of the “prolific shoplifters” — the 32-year-old man who allegedly stole more than $10,000 in merchandise from the Amazon 4-star — come into the store, take something out of a bag and give it to the owner, who then handed him $40, the investigative report states.

Police said the encounter began to dismantle the operation “brick by brick,” and officers pressed Baby Yoda into action. Earlier this month, police launched an operation in which they marked a Lego set of “The Child,” which retails for around $80, and sent an undercover detective into Rummage Around to sell it. When the detective went inside, he spotted Brady, approached him and then opened the reusable bag to reveal what he was offering.

“You want any of this?”

Brady did, but not there, police allege in the report. “Let’s do this in the corner,” police say he replied.

Once there, Brady allegedly told the detective he’d buy the Star Wars Lego set, but he grabbed the spider wire — an anti-theft lock ensnaring the Lego box — and said he didn’t like it. The undercover detective apologized, saying he’d just “boosted” it from the Amazon 4-Star, the report states. Brady said he could cut it off.

“What else do you need?” the detective asked.

“I will take Lego sets, the big ones,” police say Brady answered.

Police claim Brady told the detective to make sure the stolen merchandise was hidden when entering the store, allegedly adding that he had three cameras recording outside and didn’t want any of it caught on video.

Seattle police would later do a second run of the same operation, this time with a 1,023-piece Lego set of the Razor Crest, the spaceship featured in “The Mandalorian” series. Another undercover officer tried to sell Brady the toy spaceship outside Rummage Around, but Brady allegedly directed him inside the store.

When the detective presented the boxed set with spider wire still wrapped around it, police claim Brady said he couldn’t buy the item with the anti-theft device. The officer explained that he’d tried to cut it off but couldn’t and asked if there was a special tool he needed to do so. Brady didn’t say, according to the report, instead taking the set from the undercover officer, putting it behind a blanket and then paying him. To cap off the interaction, the officer asked if Brady wanted him to get anything else in the future.

Police say Brady replied with, “[M]ore of the same.”

On Oct. 15, police arrested Brady and seized thousands of dollars’ worth of goods from his store, including 171 Lego sets. Using RFID tags and unique identification numbers, police say an Amazon 4-star security employee identified 34 of them — worth a total of more than $2,000 — as Amazon property.

Brady told The Post he didn’t like how police spread out the Lego sets they seized from his store for a photo op, like they’d made a big drug bust of some kind of “monster.” He also said police weren’t discriminating in the sets they showcased.

“How can they prove which ones are stolen?”

Brady said his life has been “miserable” lately. He’s had several surgeries to deal with an onslaught of health problems, and business has been bad because of the pandemic — on top of that, he has been caring for a 17-year-old he considers a son. And now he’s been charged with a crime that carries a multiyear prison sentence as a maximum punishment.

“I mean, come on, that scares me,” he said.