A former D.C. lottery agent has been arrested in Los Angeles on charges he helped himself illegally to thousands of lottery tickets and then cashed in nearly $300,000 in winnings, federal prosecutors said yesterday.

Luck ran out for Soo Young Bae when federal marshals found him in California on Wednesday and alerted him to his indictment by a grand jury. Yesterday he remained jailed pending extradition to Washington, where he could face up to 15 years in prison if convicted of computer fraud and theft charges.

Officials described the case as the biggest scam ever committed against the D.C. Lottery, which began operations in 1982. They said Bae was bound to be caught, however, because of an elaborate computer monitoring system.

"This really is a rare case," said Athena Ware, a spokeswoman for the lottery. "We have a very sophisticated system that is designed to detect and monitor whenever there is something out of the ordinary, and it worked."

Prosecutors said Bae owned Montello Wine and Liquor, a store in Northeast Washington that for years had sold lottery tickets. He allegedly used the store's electronic lottery terminal to churn out more than $500,000 in tickets in October 1997.

Had he been using his own money, he would have been a big loser, authorities said: He had only 494 winning tickets, worth $296,153.

Bae's winners came in DC-4, one of several games of chance offered by the D.C. Lottery, authorities said. Tickets in the game cost either 50 cents or $1 apiece; the version Bae played paid out $599.50. According to the indictment, Bae cashed in his winning tickets at 15 stores throughout the Washington area.

His indictment came after an exhaustive investigation by lottery security officials, the D.C. inspector general's office and other agencies.

Sources familiar with the case said that the lottery's investigators became suspicious of Bae within a week of his alleged windfall. Soon after that, they went to his store to interview him, only to find the place padlocked, sources said.

The lottery uses a private firm, Lottery Technology Enterprises Inc., to monitor sales on a computer system linked to every agent's terminal. The system keeps information about daily activities by more than 500 agents, including data showing how much money is taken in and paid out, authorities said.

"We're proud of the work our agency has done," Ware said, adding, "We were at least on our end able to detect this very quickly."

Bae, 53, had lived in Fairfax and owned the liquor store in the 1600 block of Montello Avenue NE since 1992, authorities said. The U.S. Marshals Service tracked him to Los Angeles, where he had relocated, authorities said.