At the trial of a Citigroup executive a year ago, Matthew Martens attended as a spectator and watched the defense win jurors over with the “Where’s Waldo” argument.

The jury cleared Brian Stoker of the fraud charges leveled against him by the Securities and Exchange Commission — a stinging setback for the agency’s trial unit, which Martens heads. Stoker’s attorney argued that his client was a minor player at Citigroup, yet the SEC picked him out of the crowd as the sole culprit behind a mortgage deal gone bad.

“We certainly learned lessons,” Martens, 41, said in an interview Friday.

The lessons were applied with success. This week, a federal jury in Manhattan found former Goldman Sachs executive Fabrice Tourre liable for duping key investors in a complex financial deal, handing the SEC its first victory in a trial that emerged from the 2008 financial crisis.

Like Stoker, Tourre was a mid-level bank executive who helped structure a $1 billion mortgage product that collapsed when the housing market tanked. Both were accused of luring investors into a deal that was secretly designed to fail. But this time, the SEC’s narrative focused on the defendant as the driving force in a grand scheme to mislead investors for the sake of profit.

To try the case, the SEC brought its generals to the front lines, a sign of how high the stakes were for an agency struggling to hold Wall Street accountable. Lorin Reisner, deputy chief of the SEC’s enforcement division, took charge of the case in 2010. Martens joined the team the next year and became the lead attorney when Reisner left the agency.

“We recognized from the very beginning that in order to prevail, we would have to demonstrate that this was Fabrice Tourre’s deal,” said Reisner, now a federal prosecutor in Manhattan.

In court, Martens portrayed Tourre as the “deal captain,” the one with primary responsibility for structuring the mortgage product and preparing the materials used to market it to investors. The SEC seized on boastful e-mails that Tourre sent to his then-girlfriend, telling her of selling the product to “widows and orphans” and referring to himself by his now infamous “fabulous Fab” nickname.

“Mr. Tourre was not some entry-level rookie,” Martens told the jury in his closing statement. “He was all over the deal. . . . This was his deal.”

Of the 21 cases Martens has tried, this was his first jury trial since joining the SEC in 2010. Previously, he was an assistant U.S. attorney in North Carolina and a Justice Department official.

Legal experts tracking the proceedings were skeptical that the SEC could pull it off, in part because of the agency’s track record with trials stemming from the financial crisis.

After the agency lost the Stoker case in July 2012, it suffered another setback in November, when a federal jury cleared Bruce Bent, founder of the nation’s first money-market fund, of fraud charges. Jurors rejected the SEC’s claims that Bent deceived investors leading up to the catastrophic failure of his trailblazing Reserve Primary Fund.

That failure set off a panic that exacerbated the financial crisis.

Another challenge for the government was the complicated nature of the financial product at the heart of the case: a synthetic collateralized debt obligation.

“You have to educate the jury from scratch,” said Anthony Sabino, a law professor at St. John’s University. “The ramp was steep in this case, like climbing the side of the pyramid.”

And the SEC had to go toe-to-toe with some very experienced — and well-funded — lawyers, said Peter Henning, a law professor at Wayne State University Law School in Detroit. Goldman Sachs paid Tourre’s legal costs. The bank was charged along with Tourre in 2010 but settled the case for $550 million without admitting wrongdoing.

“The SEC essentially took on Goldman’s deep pocket,” Henning said. “They faced some very good lawyers with very good resources in a case that by nature was not very easy to win.”