Machias originally was authorized as a patrol gunboat with the hull number PG-161, but she was redesignated as a patrol frigate with the hull number PF-53 on 15 April 1943. She was laid down under a Maritime Commission contract as a Maritime Commission Type T.S2-S2-AQ1 hull on 8 April 1943 by Froemming Brothers, Inc., at Milwaukee, Wisconsin. She was launched on 22 August 1943, sponsored by Mrs. W. Richard Bernays, and commissioned on 29 March 1944.