Most primates typically use a diagonal-sequence footfall pattern during walking. This footfall pattern, which is unusual for mammals, is believed to have originated in ancestral primates in association with the use of grasping extremities for movement and foraging on thin, flexible branches. This theory was tested by comparing gait parameters between the grey short-tailed opossum Monodelphis domestica and the woolly opossum Caluromys philander, two didelphid marsupials that are strongly differentiated in grasping morphology of the extremities and in their reliance on foraging strategies involving thin branches. One hundred and thirty gait cycles were analysed quantitatively from videotapes of subjects moving quadrupedally on a runway and on poles of different diameters (7 and 28 mm). Duty factor (i.e. duration of the stance phase as a percentage of the stride period) for the forelimb and hindlimb, as well as diagonality (i.e. phase relationship between the forelimb and hindlimb cycles), were calculated for each of these symmetrical gait cycles. We found that the highly terrestrial Monodelphis, like most other non-primate mammals, relies primarily on lateral-sequence walking gaits on both runway and poles, and has relatively higher forelimb duty factors. Like primates, the highly arboreal Caluromys uses primarily diagonal-sequence walking gaits on the runway and pole, with relatively higher hindlimb duty factors and diagonality. The fact that the woolly opossum, a marsupial with primate-like feet that moves and forages mainly on thin branches, uses primarily diagonal-sequence gaits when walking supports the view that primate gaits evolved to meet the demands of locomotion on narrow supports. This also demonstrates the functional role of a grasping foot, in association with relatively higher hindlimb duty factors, protraction, and substrate reaction forces, in the production of such walking gaits.