The Martin P5M Marlin, built by the Glenn L. Martin Company of Middle River, Maryland, was the last flying boat in service with the United States Navy and the US armed forces in general. Built as a successor to the PBM Mariner, the new hull form and new conventional tail were fitted to a Mariner to become the XP5M Marlin prototype.
The Marlin was designed as a gull-winged aircraft to lift the engines and propellers high above the spray. Power was by two Wright R-3350 radial engines. The hull, somewhat inspired by the Japanese Kawanishi H8K of World War II, did not lift sharply from the water at the tail, instead rising up steadily, this gave the aircraft a longer base of flotation and reduced "porpoising" over waves.
The prototype had nose and tail turrets with twin 20 mm cannon in each, as well as a dorsal turret with two 0.5 in (12.7 mm) M2 machine guns. The cockpit area was the same as the Mariner's. It first flew in May 1948.
The first of 167 production P5M-1 aircraft was produced in 1949. Changes from the prototype included a raised flight deck for improved visibility, the replacement of the nose turret with a large radome for the AN/APS-44 search radar, the deletion of the dorsal turret, and new, streamlined wing floats. The engine nacelles were lengthened to provide room for weapons bays in the rear.
The P5M-1 was followed by 116 P5M-2 planes. These had a T-tail to put the tail surfaces out of the spray, a AN/ASQ-8 MAD boom at the rear of the tail-tip, no tail guns, better crew accommodation and an improved bow to reduce spray during takeoff and landing.