Not all of the machines will be replaced. Castelveter said that some airports that now have backscatter scanners will go back to having metal detectors. That's what most airports used before scanners were introduced.

The Rapiscan scanners have been on their way out for months, in slow motion.

The government hadn't bought any since 2011. It quietly removed them from seven major airports in October, including New York's LaGuardia and Kennedy airports, Chicago's O'Hare, and Los Angeles International. The TSA moved a handful of the X-ray scanners to very small airports. At the time, the agency said the switch was being made because millimeter-wave scanners moved passengers through faster.

Rapiscan parent company OSI Systems Inc. said it will help the TSA move the scanners to other government agencies. It hasn't yet been decided where they will go, said Alan Edrick, OSI's chief financial officer, in an interview.

Scanners are often used in prisons or on military bases where privacy is not a concern.

"There's quite a few agencies which will have a great deal of interest" in the scanners, Edrick said.

OSI is taking a one-time charge of $2.7 million to cover the money spent trying to develop software to blur the image, and to move the machines out of airports, Edrick said.

The contract to change the software on the scanners came under scrutiny in November when the TSA delivered a "show cause" letter to the company looking into allegations that it falsified test data, which the company denied. On Thursday it said final resolution of that issue needs approval by the Department of Homeland Security.

The agreement with the TSA is an indication that OSI Systems will be cleared of the issues raised by the agency, Roth Capital Partners analyst Jeff Martin wrote on Friday. OSI shares soared $2.37, or 3.5 percent, to close at $70.02.

If you liked this article you might like

What's Behind the Surge in Energy Stocks

Hillary Clinton Says Prosecuting Individuals is Key to Wall Street Reform