The earthquake was recorded at 20:00 GMT, 46 kilometers (28.5 miles) to the northeast of the city of Khachmaz, with its epicenter at a depth of 35 kilometers.
There have been no immediate reports of casualties or material damage.
A 5.4 magnitude quake is typically strong enough to be felt by those in the surrounding area, and usually only causes just minor damage.
"It was shaking quite well by 4-4.5 points, it felt it like for a couple of seconds, I thought it had passed, but after a couple of seconds it shook again, but weaker," one testimony reads.
"It felt like someone shook my couch," wrote another on emsc-csem.org.
"Was about 50 seconds," another testimonial attested.