I believe the correct answer is that the sheriff is an elected law enforcement official.
Even if you take a look at the definition of a sheriff on Wiki, you will see that it says that a sheriff is an elected individual who is responsible with upholding the law within counties. Although this depends on a county, 99% of the time a sheriff is elected.