The Department of San Martín is located in the upper part of the Peruvian Amazon rainforest in northern Peru. The capital is Moyobamba and the largest city in the department is Tarapoto. The west is the eastern side of the Andean Plateau, with a rough topography and many gorges. The southwest are the foothills of the Cordillera Azul, with low elevation and the Cajón de Sión gorge with the Cayumba rapids. The Huallaga River and its affluents form wide valleys with stepped terraces where most of the people live, mostly of cattle and agriculture. There is also a small lower jungle zone.