Updated

A federal appeals court in New York says investors in Bernard Madoff's epic fraud cannot hold the Securities and Exchange Commission responsible for failing to expose his Ponzi scheme.

The 2nd U.S. Circuit Court of Appeals rejected the lawsuit by investors on Wednesday. It upheld a lower-court ruling that found the SEC could not be held responsible.

The appeals court said the agency's actions and "regrettable inaction" are shielded by rules protecting government employees from lawsuits when they carry out a discretionary function or duty.

The court noted that the SEC missed many opportunities to uncover Madoff's multibillion-dollar fraud.

Madoff pleaded guilty in 2009 to fraud. He is serving a 150-year prison sentence.

Investors' lawyers say the SEC wronged investors and the lawsuit was necessary. The government had no comment.