Contrite U.S. Securities and Exchange Commission officials apologized for bungling five probes that should have uncovered Bernard Madoff's $65 billion fraud and pledged to overhaul the way the agency operates.

A scathing report issued last week by SEC Inspector General David Kotz found that the agency missed numerous red flags, did not properly follow up on leads and dismissed tips and complaints that might have uncovered Madoff's investment sham.

At a congressional hearing to examine the SEC's shortcomings, top SEC officials said that in the Madoff case the agency failed in its fundamental mission to protect investors.

It is a sobering and humbling experience, said the SEC's director of enforcement Robert Khuzami and John Walsh, the agency's acting director of exams and compliance, in joint testimony to Congress.

We deeply regret our failure to detect the Madoff fraud and pledge to continue to fix the problems that contributed to this failure, said Khuzami and Walsh, both of whom described reforms underway.

Madoff pleaded guilty in March and is now serving a 150-year prison term.

Lawmakers expressed outrage over the SEC's missteps. Richard Shelby, the top Republican on the Senate Banking Committee, threatened the agency with legislation if it refused to reform itself.

Democratic Senator Robert Menendez asked who should be held accountable and suggested that staffers who dropped the ball on the Madoff case be fired. Where there is gross incompetence... the first thing you have to do is clean house, Menendez said.

An SEC spokesman said the agency will thoroughly examine all of the conduct and take appropriate action

Senate Banking Chairman Christopher Dodd said the SEC's culture needs to be reformed to encourage aggressive investigations and said the agency should hire staff with real-world experience.

Khuzami and Walsh said this was underway and agreed with Democratic Senator Charles Schumer's proposal to give the SEC a bigger budget and allow the agency to keep the fees it collects. Currently Congress appropriates the SEC's budget.

Thursday's hearing was in sharp contrast to a February hearing when a House of Representatives panel excoriated five closed-lipped SEC officials. Four of the five SEC officials that testified at that hearing have since left the agency.

REFORMS AFOOT

Kotz outlined dozens of recommendations to improve SEC procedures for handling tips and examining individuals and companies.

He urged the SEC to make sure that complaints were properly vetted, saying tips and complaints had to be reviewed by staff who had related experience.

Kotz's report detailed, for example, how three staffers discounted a detailed 2005 complaint about Madoff by Harry Markopolos because he was a competitor rather than a Madoff employee or investor.

The three staffers -- two who were relatively senior employees -- had never investigated a Ponzi scheme, where initial investors are paid with money from newer investors.

SEC Chairman Mary Schapiro has asked Congress to give the agency authority to compensate whistleblowers. The SEC is revamping the way it handles complaints and tips and is seeking a more centralized process to identify leads for potential enforcement action and compliance exams.

Kotz said Schapiro understands the importance of changing things. Since Schapiro has taken the top job at the SEC she has instituted changes to speed up the pace of enforcement, such as making it easier for staff attorneys to negotiate penalties and use subpoenas.

Khuzami has cut the number of managers at the SEC, plans to create specialized teams to investigate cases and said his division was going to implement a more rigorous performance evaluation process for staff.

Walsh's office of compliance, inspections and examinations has created a new senior specialized examiner to attract industry professionals with experience in trading, portfolio management valuation and complex products to name a few.

Some lawmakers are seeking more money for the SEC, which is understaffed and underfunded when compared to banking regulators.

At the hearing, Markopolos -- now a fraud examiner -- urged Congress to pass strict laws to hold heads of government agencies responsible.

Putting agency heads in prison for willful blindness, malfeasance and corruption seems like it's long overdue, said Markopolos, who repeatedly tried to warn the SEC that Madoff's operations were a sham.

(Reporting by Rachelle Younglai; Editing by Neil Stempleman, Tim Dobbyn and Bernard Orr)