In the early days of the Obama administration, I sat in a Capitol Hill hearing room and listened to Harry Markopolos, the whistle-blower in the Bernie Madoff scandal, bemoan the toothless Securities and Exchange Commission.

The SEC, which ignored his warnings about Madoff, is “captive to the industry it regulates, and it is afraid of bringing big cases against the largest, most powerful firms,” he said. “The SEC continues to roar like a mouse and fight like a flea. … I gift-wrapped and delivered the largest Ponzi scheme in history to them, and somehow they couldn’t be bothered to conduct a thorough and proper investigation.”

But since then, the private investigator has come upon a rather different trail of evidence. “There’s a total sea change at the agency,” Markopolos told me Tuesday. “They are aggressive. There’s no more free passes on Wall Street. They eagerly seek out big cases. … They used to be industry’s lapdog and now they’re actually an investor’s watchdog.”

The difference, he said, is Mary Schapiro, who announced Monday that she will step down as SEC chairman after four tumultuous years on the job. It’s not a stretch to say she has saved the regulatory body from irrelevance, if not outright extinction, and she has rebuilt it into a powerful presence on Wall Street. When she took over the agency, voices inside and outside the administration were calling for carving up the agency, which missed the Madoff scandal.

Instead, the SEC wound up gaining authority under the Dodd-Frank financial legislation, and it is now filing more enforcement actions — 734 in fiscal year 2012 and 735 in 2011 — than at any point in its history. It has issued a flurry of new regulations, recovered billions of dollars for investors and taxpayers and gone after top officials and giant firms such as Fannie Mae, Freddie Mac, Citigroup, Bank of America, Goldman Sachs and JPMorgan Chase over their role in the financial crisis. The SEC uncovered one of the largest-known insider-trading schemes, at Raj Rajaratnam’s Galleon Group.

And how has the financial industry fared under the aggressive new SEC? Well, the Dow Jones Industrial Average is up about 60 percent since she took over. Wall Street firms’ profits this year are forecast to be $15 billion, double last year’s level. It’s hard to say banks have suffered.

The turnaround is more significant than one woman’s achievement. It shows that tough regulation can be good for everybody — even the industries that reflexively complain about government rules.

Certainly, Schapiro’s tenure has not been all triumph. The SEC has implemented only about 30 percent of the regulations it needs to do under Dodd-Frank. The rule-making process has been slowed down by industry (the U.S. Chamber of Commerce got a federal appeals court to invalidate one of its first major efforts, the “proxy access” rule) and by liberal critics, including SEC Commissioner Luis Aguilar, who hold out for more aggressive regulations. Aguilar joined this summer with the Republican commissioners to kill an effort by Schapiro to tighten regulation of the mutual-fund industry.

Democratic lawmakers have criticized the SEC for foot-dragging in finalizing the high-visibility Volcker Rule, which restricts banks from gambling with their own money. Schapiro has also drawn complaints that she settled cases with offenders for too little and that she hasn’t done enough to restrict the high-speed computer trading that caused the “flash crash” of 2010, when the Dow dropped 600 points in 15 minutes.

But there is no doubt she revived the SEC from its moribund state in 2009, and she substantially strengthened financial regulations. She used her political skill — gained in previous stints as an SEC commissioner and chairman of the Commodity Futures Trading Commission — to shake up the bureaucracy at the agency and to protect the SEC’s powers. When the Obama administration floated a proposal to break up the agency in 2009, she went public with her objections; the White House backed down.

Inside the agency, she simplified and accelerated enforcement actions and increased the agency’s ability to respond to tips — the sort of thing that would have allowed Harry Markopolos to stop Madoff. “If it hadn’t been for her, that agency wouldn’t exist today,” he said. “Now they take on industry, and they’re not afraid. Investors are a lot safer today because of what she’s done.”

If they’re being honest, the banks will have to admit that the confidence she restored in SEC has made them better off, too.

Dana Milbank is a columnist for The Washington Post. His e-mail address is