Two computer programmers who worked for Bernard L. Madoff’s brokerage firm were arrested on Friday and accused of helping him sustain his long-running Ponzi scheme.

The two men  Jerome O’Hara of Malverne, N.Y., and George Perez of East Brunswick, N.J.  were also named in a civil case filed on Friday by the Securities and Exchange Commission.

Securities regulators said that the two men created the computer software that generated the elaborate paper trail that Mr. Madoff used to conceal his fraud from investors and regulators for more than 15 years.

According to the complaints, both men grew uneasy about their role in the fraud three years ago and closed their own Madoff accounts in April 2006, withdrawing hundreds of thousands of dollars.