Transportation Security Administration officers will now be required to wear masks when they screen passengers at airport security checkpoints.

The decision, announced Thursday, comes as airlines began implementing mandatory mask policies for passengers and crew members. On Thursday, Amtrak also announced that passengers would have to wear masks when they travel.

Officials said the goal is to help stop the spread of the coronavirus, which has continued to sicken thousands across the country. More than a million people in the United States have been infected, and more than 77,000 have died. At the TSA, more than 500 employees have contracted the virus and at least six have died.

Masks had been optional for officers. The TSA said officers may also wear protective eyewear if they choose, but the agency will not require it.

“TSA is making this change to protect our employees and travelers as social distancing cannot always be maintained in the screening process,” TSA Administrator David Pekoske said in a statement that accompanied the announcement.

The agency said that passengers are encouraged to wear facial protection but may be asked to lower their coverings temporarily to be identified or if they trigger an alarm when being screened. Airlines also are requiring passengers to wear masks during the check-in process.

The TSA has made other adjustments to the screening process. It has installed floor markers to encourage spacing between travelers as they enter screening lines. At some airports, screening lanes have been staggered and clear barriers have been installed. The agency also is allowing travelers to bring bottles of hand sanitizer as large as 12 ounces through checkpoints.