An earthquake measuring 5.4 in magnitude struck western Iran near its border with Iraq on Friday morning, Iranian media reported.