The earthquake also damaged two mosques in Istanbul.

A moderate 5.7 magnitude earthquake shook buildings and damaged two mosques in Istanbul on Thursday, slightly injuring eight people and causing residents to rush from buildings.

Witnesses in the city of 15 million, Turkey's largest, felt buildings sway and said some offices and schools were temporarily evacuated. Three major seismic fault lines criss-cross Istanbul, which straddles Europe and Asia.

"The quake really shook at the start and then it continued, maybe it felt like that because the building is so tall," said Ozge Etcan, 27, an employee at a financial firm in Istanbul's Levent district, where crowds gathered outside in the aftermath.

The tremor was at a depth of 12.6 km, the Kandilli Observatory and Earthquake Research Institute said, locating its epicentre 70 km (44 miles) west of Istanbul in the Marmara Sea, south of the town of Silivri. It struck at 1:59 p.m. (1059 GMT).

Both the observatory and the U.S. Geological Survey assessed its magnitude at 5.7.

"Despite this earthquake having a magnitude that could be considered serious, we have not as yet received heartbreaking news, just some small damage," President Tayyip Erdogan told a news conference.

He said eight people had been treated for slight injuries, but did not provide further details.

The top section of a minaret had collapsed at the central mosque in Istanbul's Avcilar district, close to the Marmara Sea, CNN Turk footage showed.

Another minaret collapsed in the Sariyer district of the city, the municipality's disaster coordination centre said.

"There will be aftershocks of this quake. What we ask from citizens is that they don't enter damaged buildings," Murat Nurlu, head of the earthquake department at Turkey's Disaster and Emergency Management Directorate (AFAD), told Reuters.

SOME BUILDINGS DAMAGED

Cracks emerged in some buildings across the city. Two of them in the Sultangazi and Eyup districts were damaged, AFAD said in a statement, clocking the quake at 5.8 magnitude.

Mobile phone users had difficulty making calls shortly after the quake. AFAD said work was continuing to resolve the problem in communications.

The epicentre was 22 km from the nearest inhabited area, Silivri, AFAD said. It said there had been 28 aftershocks, the strongest of which had a magnitude of 4.1.

The Istanbul governor's office said primary and middle schools had been ordered shut for the remainder of the day.

In 1999, a quake measuring 7.6 struck the city of Izmit, 90 km southeast of Istanbul, killing more than 17,000 people.

Recep Kutuk, a 37-year-old civil servant, said he experienced two major earthquakes in the region in 1999 and this had made him sensitive to any tremor.

"It was really powerful. I hope this is not a precursor to another major earthquake," he said.