Lecheton Settles, 30, of Herndon, Va., was arrested Saturday morning.
He's accused in an attack that happened at a hotel near Seattle-Tacoma International Airport.
Settles called an escort to his room, showed her his badge, and then pulled his government-issued gun on her, police said.
Then, Settles forced the woman to have sex, telling her he was a U.S. marshal, authorities said.
Settles has been charged with first-degree rape.
The Transportation Security Administration said he has been fired.
"The men and women of the Federal Air Marshal Service (FAMS) are dedicated to protecting the travelling public each and every day," the TSA said in a statement. "Employees who have engaged in acts of misconduct will be subject to the full range of disciplinary action permitted by policy; up to and including termination."