NEW YORK — Five former employees of imprisoned financier Bernard Madoff enriched themselves and helped “perpetuate Madoff’s elaborate fiction” by weaving an elaborate web of lies that for decades duped investors and government regulators, a prosecutor said Wednesday as the workers’ criminal trial began.

“These are the people who helped him do it,” said Assistant U.S. Attorney Matthew Schwartz, pointing at each defendant in federal court in Manhattan. “Bernie Madoff needed help to fool so many people for so long. … A fraud of this scope and duration could not have been carried out alone.”

Later, he added: “For year after year after year, they lied for the most simple reason — greed.”

The remarks came during opening statements at a trial that’s expected to last five months and showcase testimony of Frank DiPascali, Madoff’s former finance chief, and five other insiders who pleaded guilty and agreed to cooperate in the case. Defense attorneys were expected to give their opening statements Thursday.

The defendants — Annette Bongiorno, Madoff’s longtime secretary; Daniel Bonventre, his director of operations for investments; JoAnn Crupi, an account manager; and computer programmers Jerome O’Hara and George Perez — all have pleaded not guilty. They have claimed they were led astray by Madoff and in the dark about his epic fraud.

The trial is the first to result from the 2008 collapse of Madoff’s private investment business, which cost clients nearly $20 billion. A court-appointed trustee has recovered much of the money by forcing those customers who received big payouts from Madoff to return the funds. When the fraud was revealed, Madoff admitted the nearly $68 billion he claimed existed in accounts was actually only a few hundred million dollars.

Schwartz described the defendants as “necessary players” in Madoff’s fraud, saying Bongiorno, hired in 1968, and Crupi, hired in 1983, used old stock tables to fabricate account statements and other fake records — “millions of pages of lies” — that kept the Securities and Exchange Commission at bay. They also rewarded themselves with tens of millions of dollars in salary and bonuses from a “slush fund” of stolen money, including $2.5 million for a beach house for Crupi, he said.