An earthquake of magnitude 5.1 struck the province of Kohgiluyeh and Boyer Ahmad in western Iran on Sunday, the U.S. Geological Survey reported.