The capybara and the lesser capybara belong to the subfamily Hydrochoerinae along with the rock cavies.