Like the Rio Grande, the Pecos River flows mostly southward across New Mexico. Unlike the Rio Grande, it rises within the borders of the state, having its headwaters not far to the east of Santa Fe. Its tributaries are mountain streams the flow eastward out of the southernmost part of the Rocky Mountains. South of Carlsbad, it flows into the state of Texas and continues several hundred more miles before joining the Rio Grande.