The 6.3-magnitude quake shook southern Turkey and northwestern Syria, causing panic among some residents while others were trapped in collapsed buildings.