ISTANBUL — An earthquake with a preliminary magnitude of 6.7 shook eastern Turkey on Friday night, killing at least 22 people, injuring hundreds and causing tremors in three neighboring countries, the authorities said.

The earthquake struck just before 9 p.m. in eastern Elazig province, Suleyman Soylu, Turkey’s interior minister, told reporters. At least 225 people were injured in Elazig and another 45 people were hurt in the nearby province of Malatya, southwest of the epicenter, provincial officials said. More than 1,000 people sought treatment at hospitals for injuries, anxiety and heart attacks after the quake.

Mr. Soylu told NTV television that rescue workers were trying to reach survivors after a four-story building collapsed in the town of Maden. One person was rescued from the rubble there, he said. Four or five buildings collapsed in Sivrice, where two people were hurt, he said.

“We are hoping we will not have more casualties,” Mr. Soylu said, according to the Anadolu news agency.