A shallow earthquake of magnitude 5.6 struck off the tiny South Pacific nation of Samoa, the United States Geological Survey said on Tuesday.