As part of the viral infection cycle, viruses must package their newly replicated genomes for delivery to other host cells. Bacteriophage φ29 packages its 6.6-μm long, double-stranded DNA into a 42 × 54 nm capsid by means of a portal complex that hydrolyses ATP. This process is remarkable because entropic, electrostatic and bending energies of the DNA must be overcome to package the DNA to near-crystalline density. Here we use optical tweezers to pull on single DNA molecules as they are packaged, thus demonstrating that the portal complex is a force-generating motor. This motor can work against loads of up to 57 pN on average, making it one of the strongest molecular motors reported to date. Movements of over 5 μm are observed, indicating high processivity. Pauses and slips also occur, particularly at higher forces. We establish the force-velocity relationship of the motor and find that the rate-limiting step of the motor's cycle is force dependent even at low loads. Notably, the packaging rate decreases as the prohead is filled, indicating that an internal force builds up to ∼50 pN owing to DNA confinement. Our data suggest that this force may be available for initiating the ejection of the DNA from the capsid during infection.