Birds take off and land on a wide range of complex surfaces. In contrast, current robots are limited in their ability to dynamically grasp irregular objects. Leveraging recent findings on how birds take off, land, and grasp, we developed a biomimetic robot that can dynamically perch on complex surfaces and grasp irregular objects. To accommodate high-speed collisions, the robot's two legs passively transform impact energy into grasp force, while the underactuated grasping mechanism wraps around irregularly shaped objects in less than 50 milliseconds. To determine the range of hardware design, kinematic, behavior, and perch parameters that are sufficient for perching success, we launched the robot at tree branches. The results corroborate our mathematical model, which shows that larger isometrically scaled animals and robots must accommodate disproportionately larger angular momenta, relative to their mass, to achieve similar landing performance. We find that closed-loop balance control serves an important role in maximizing the range of parameters sufficient for perching. The performance of the robot's biomimetic features attests to the functionality of their avian counterparts, and the robot enables us to study aspects of bird legs in ways that are infeasible in vivo. Our data show that pronounced differences in modern avian toe arrangements do not yield large changes in perching performance, suggesting that arboreal perching does not represent a strong selection pressure among common bird toe topographies. These findings advance our understanding of the avian perching apparatus and highlight design concepts that enable robots to perch on natural surfaces for environmental monitoring.