WESTPORT — More than $3 million in retirement savings a resident was duped into investing in bitcoin, then stolen earlier this year in what police call an “elaborate” scam orchestrated in Pakistan, has been recovered by Westport detectives working with state investigators.

The Westporter, who was not identified in a police statement Friday, allegedly was scammed in January to move funds from a retirement savings account into a “Kraken” cryptocurrency account.

The victim told police that after depositing funds into that account, approximately $3.2 million worth of bitcoin was withdrawn through March, and transferred to cryptocurrency wallets the victim did not control.

Westport police detectives, working with the State Police Organized Crime Task Force, launched an investigation into the theft in May and were “able to track the transactions and effectively freeze all accounts associated with this scam,” police said Friday.

The scam, police said, appears to have originated in Pakistan, making arrests in the case highly unlikely.

The full amount of stolen funds, however, has been recovered and returned to the Westport victim, police said,

While lauding the work by investigators in the case, police officials warned residents to be “cautious with the ever-changing scams that continue to infiltrate our community.”

Two weeks ago, for instance, Westport police issued a warning that scammers were calling residents — with a phone number that appeared to be the department’s non-emergency line — trying to bilk people out of purported “fines” for failing to appear for non-existent court dates.