A crash-development program began after the July 1941 German night bombing of Moscow to field a night fighter with heavy armament and long endurance. Only an aircraft currently in production could be used to satisfy the extremely tight deadline and the Pe-2 was selected for modification by the State Commissariat for Defence (Russian: Narodnyy Komissariaht Oborony—NKO) as the fastest twin-engined aircraft in service. The order only authorized four days to modify the aircraft's fuel, armament and radio systems, but this deadline was met when the modified aircraft made its first flight on 7 August and it passed its manufacturer's trials the following day.
Three additional fuel tanks, with a capacity of 700 liters (154 imp gal; 185 U.S. gal) were fitted in the prototype, one in the fuselage bomb bay and the other two replaced the ventral gunner's position. The nose armament was reinforced with an additional 12.7-millimeter (0.50 in) Berezin UBK machine gun with 150 rounds and a fixed 7.62-millimeter (0.300 in) ShKAS machine gun with 250 rounds was added in the tail cone. Removal of two of the fuselage bomb racks reduced the maximum bomb load to 700 kilograms (1,543 lb), one 250-kilogram (551 lb) bomb on each of the fuselage racks and one 100-kilogram (220 lb) in each of the engine nacelles. The electric bomb release system was removed and the bombs had to be dropped using the mechanical system, initially designed as the emergency system. The dive brakes under the wings were also removed. The BSBbis radio was exchanged for the RSI-4 model commonly used in single-seat fighters and the radio direction finder was also removed to save weight. The prototype weighed 5,890 kg (12,985 lb) empty and it had a normal take-off weight of 7,800 kg (17,196 lb), slightly heavier than the version of the Pe-2 then in production. During testing it demonstrated a maximum speed of 530 km/h (329 mph) at 5,000 meters (16,404 ft), a service ceiling of 9,000 meters (29,528 ft) and a maximum range of 2,150 km (1,336 mi). This was considered adequate and Factory (Russian: Zavod) Nr. 39 in Moscow was ordered on 14 August to build five pre-production aircraft for delivery by 25 August. This process proved difficult because drawings had not been made for many of the new parts and they had to be fitted by hand, slowing the production rate.
Slightly more extensive testing of a pre-production aircraft was done by the Air Force Scientific Test Institute (Russian: Nauchno-Issledovatel'skiy Institoot Voyenno-Vozdushnykh Seel—NII VVS) between 29 August and 7 September. Although they confirmed the initial performance figures, the tests revealed other problems. The lower nose Plexiglas windows cracked when the lower UBK machine gun was fired, a problem initially cured by replacing some of the glazing with a duralumin skin, but this too proved to be too weak, and it was itself later replaced by a steel panel. Pre-production testing also revealed that the casings and links from the large-caliber weapons damaged the skin of the wings and sometimes entered the radiator intakes, where they could cause extensive damage. Revising the shape of the ejector chutes did not help and the casings had to be collected in the nose. Pre-production testing also identified several other specific weaknesses that had to be corrected on the production line. The Pe-3's offensive firepower was too weak and a 20-millimeter (0.79 in) ShVAK cannon was added. The firepower of the dorsal 7.62mm ShKAS machine gun was considered inadequate, and on the production line, was replaced by a 12.7 mm Berezin UBT machine gun. To protect the crew, the production line added frontal armor and extended existing armor to the rear to protect the navigator. The production line also replaced the RSI-4 radio with model that had greater range and added a camera for the Pe-3's reconnaissance role. Although most of the initial aircraft were delivered without these adaptations, they were modified in the field by factory teams.
The first Pe-3s were issued to the 95th High-Speed Bomber Regiment in the Moscow Military District and the Regiment's experiences with the aircraft revealed other problems. Firing the guns at night dazzled the pilot and destroyed his night vision and the glare from searchlights through the glazing on the lower nose also blinded the pilot. Crews complained bitterly that the lack of frontal armor made them vulnerable to defensive fire from German bombers. Flash hiders installed on the guns and curtains covering the windows cured the first problems, but the lack of armor could not be rectified immediately. Many aircraft were also fitted with launchers for four to six RS-82 and RS-132 rockets for ground-attack missions. Another common addition was a launcher for DAG-10 aerial grenades mounted in the tail.
The Petlyakov design bureau addressed these concerns in September and they were tested in the Pe-3bis prototype between September and October. The armament was upgraded with 250 rounds provided for each of the UBK machine guns, a 20 mm ShVAK cannon with 250 rounds was mounted in the nose and a 12.7 mm Berezin UBT machine gun with 180 rounds in boxes replaced the 7.62 mm ShKAS in the dorsal position. Frontal armor was installed and the navigator's seat armor was thickened with a total weight of 136 kg (300 lb). Automatic leading edge slats were fitted and the nitrogen fuel tank pressurization system was replaced by one that used inert gases from the engine exhaust. The crash pylon was moved forward 48 centimeters (1 ft 7 in) and the cockpit canopy shortened.
Many of these changes were made to aircraft before Pe-3bis production resumed in April 1942 and combat-use revealed several additional problems that had to be addressed in a second Pe-3bis prototype, which began its State acceptance tests in May 1942. Reloading the nose guns proved to be time-consuming, taking up to 45 minutes, and the night-firing of the port-side UBK continued to blind the pilot. These problems prompted the transfer of both UBK guns to the wing center section where they were installed in a compartment that was hinged at the front to drop down and allow easier access to the guns and their ammunition. The starboard gun was given 230 rounds and the port gun had 265 rounds. This change reduced the capacity of the Nr. 7 fuel tank by 100 liters (22 imp gal; 26 U.S. gal), but an asbestos bulkhead was added to protect the tank from heat generated by the guns. The changes meant that the cartridge cases from the ShVAK cannon could not be collected, making the skin and lower fuselage vulnerable. These were reinforced with steel sheets to minimize the damage inflicted by the large-caliber cases. The original mounting for the dorsal UBT machine gun provided an excellent field of fire, but lack of aerodynamic balance prevented the gunner/navigator to use its full range. Pressure exerted by the airstream prevented the gunner from traversing more than about 40–50° from the centerline. A twin-petal compensator proved mostly ineffective. The crash pylon was removed to give the gunner more working space. The ammunition box of the UBT was too small, only 30 rounds, and took about a minute to reload. The boxes were deleted and the UBT was given a 200-round belt with an electric drive to help to prevent feed problems. An anti-icing system was added for the propellers and the pilot's windscreen. The nose glazing was replaced entirely and the crew's armor was increased to a total weight of 148 kg (326 lb). These changes moved the aircraft's center of gravity forward and the landing gear struts were lengthened, moving the wheels 60 mm (2.4 in) forward, which helped to reduced the chance of the aircraft tipping over.