Federal prosecutors say Robert Dooley had an unusual way of persuading Home Depot clerks that he could be trusted when returning stolen merchandise for store credit cards: he flashed his Internal Revenue Service identification badge.

Over the course of three years, Dooley allegedly stole more than $330,000 from the home improvement chain by returning stolen goods for the credit cards, then selling those cards at a discount, court documents said. He was charged Thursday with 12 counts of wire fraud in connection with the scam.

Dooley has been serving a state sentence in connection with the Home Depot thefts since October 2005.

In court documents, prosecutors allege that between May 2002 and October 2005, Dooley stole more than 300 items from Home Depot stores in nine states and returned them for store credit. Dooley, 47, formerly of Salem, worked as a clerk at the IRS service center in Andover from February 2001 to September 2002.

Typically, prosecutors said, Dooley would visit a store, put several items in a shopping cart and take them to the return desk. He would tell the clerk he wanted to return the items, but didn't have a sales receipt.

Although Home Depot allowed people to return items without receipts, clerks required customers to show photo identification when doing so. Prosecutors said Dooley would show his IRS badge as proof of his identity, and would sometimes tell the clerk that he was "trustworthy" because he worked for the IRS.

A spokesman for Atlanta-based Home Depot, Jerry Shields, said the company worked closely with law enforcement.

"The Home Depot is appreciative of the efficient work of the United States Attorney's Office, the Department of Treasury Inspector General for Tax Administration and the various other law enforcement agencies who have invested considerable time and effort in investigating and prosecuting this case," Shields said in a statement.

Dooley's attorney, Oscar Cruz, did not immediately return calls seeking comment.

The wire fraud charges stem from the fact that each time Dooley returned an item he had not purchased, store credit information was transmitted by wire and stored electronically in a Home Depot computer server located outside Massachusetts.

Dooley is accused of stealing merchandise from Home Depot stores in Massachusetts, Maine, New Hampshire, Connecticut, Vermont, New York, Rhode Island, Texas and Oklahoma. He was apprehended in October 2005 while attempting to return items he allegedly had stolen from a Home Depot store in Reading.

If convicted of the federal charges, Dooley faces up to 20 years in prison.