An earthquake with a magnitude of 6.2 hit the Marmara Sea near the western outskirts of Istanbul on Wednesday, officials said, with the impact felt across Turkey's largest city where people rushed onto the streets.