Initially intended as a very long-range (VLR) escort fighter, the F-82 was designed to escort Boeing B-29 Superfortress bombers on missions exceeding 2,000 miles (3,200 km) from the Solomons or Philippines to Tokyo, missions beyond the range of the Lockheed P-38 Lightning and conventional P-51 Mustangs. Such missions were part of the planned U.S. invasion of the Japanese home islands, which was forestalled by the surrender of Japan due to the dual actions of the atomic bombings of Hiroshima and Nagasaki and the opening of Soviet attacks on Japanese-held territory in Manchuria.
In October 1943, the North American Aircraft design team began work on a fighter design that could travel over 2,000 mi (3,200 km) without refueling. It consisted of a twin-fuselage design, somewhat similar to the experimental German Messerschmitt Bf 109Z "Zwilling". Although based on the lightweight experimental XP-51F, which would later become the P-51H Mustang, it was actually an entirely new design. North American Design Chief Edgar Schmued incorporated two P-51H Mustang fuselages lengthened by the addition of a 57 in (145 cm) fuselage plug located behind the cockpit where additional fuel tanks and equipment could be installed. These were mounted to a newly designed center wing section containing the same six .50 caliber M2 Browning machine guns as a single-engine Mustang, but with more concentrated fire. The outer wings were strengthened to allow the addition of hard points for carrying additional fuel or 1,000 pounds (500 kg) of ordnance. The two vertical tails were also from the XP-51F, but incorporated large dorsal fillets for added stability in case of an engine failure. The aircraft had a conventional landing gear with both wheels retracting into bays under each fuselage center section.
The XP-82 was to be powered by two Packard-built Rolls-Royce V-1650 Merlin engines. Initially, the left engine was a V-1650-23 with a gear reduction box to allow the left propeller to turn opposite to the right propeller, which was driven by the more conventional V-1650-25. In this arrangement both propellers would turn upward as they approached the center wing, which in theory would have allowed better single-engine control. This proved not to be the case when the aircraft refused to become airborne during its first flight attempt. After a month of work North American engineers finally discovered that rotating the propellers to meet in the center on their upward turn created sufficient drag to cancel out all lift from the center wing section, one quarter of the aircraft's total wing surface area. The engines and propellers were then exchanged, with their rotation meeting on the downward turn, and the problem was fully solved. The first XP-82 prototype (44-83886) was completed on 25 May 1945, and made the type's first successful flight on 26 June 1945. This aircraft was accepted by the Army Air Forces on 30 August 1945, whose officials were so impressed by the aircraft, while still in development, that they ordered the first production P-82Bs in March 1945, fully three months before its first flight.
Prototype XP-82s, P-82Bs and P-82Es retained both fully equipped cockpits so that pilots could fly the aircraft from either position, alternating control on long flights, while later night fighter versions kept the cockpit on the left side only, placing the radar operator in the right position.
Although some P-82B airframes were completed before the end of World War II, most remained at the North American factory in California waiting for engines until 1946. As a result, none saw service during the war.
Like several versions of the P-51 Mustang, the first two prototype XP-82s as well as the next 20 P-82B models were powered by British-designed Rolls-Royce Merlin engines, built under license by Packard. These provided the fighter with excellent range and performance; however, the Army had always wanted to give the Twin Mustang a purely American and stronger engine than the foreign-designed P-51's V-1650 (built at Packard plants, dismantled after the war). In addition, the licensing costs paid to Rolls-Royce for each V-1650 were being increased by Britain after the war. It therefore negotiated in August 1945 with the Allison Division of the General Motors Corporation for a new version of the Allison V-1710-100 engine. This forced North American to switch subsequent production P-82C and later models to the lower-powered engines. It was found that Allison-powered P-82 models demonstrated a lower top speed and poorer high-altitude performance than the earlier Merlin-powered versions. The earlier P-82B models were designated as trainers, while the "C" and later models were employed as fighters, making the P-82 one of the few aircraft in U.S. military history to be faster in its trainer version than the fighter version.
In 1948, the 3200th Proof Test Group at Eglin AFB, Florida, fitted the 4th F-82B Twin Mustang (44-65163) with retractable pylons under the outer wings capable of mounting 10 High-Velocity Air Rockets (HVAR) each, which folded into the wing undersurface when not in use. This installation was not adopted on later models, the standard "tree" being used instead. The 13th aircraft (44-65171). was experimentally fitted with a center wing mounted pod housing an array of recon cameras, and was assigned to the 3200th Photo Test Squadron, being designated, unofficially, the RF-82B.