Two men — a 22-year-old Swede and a 39-year-old Turk — died when the White Corner, a bar in which they had been drinking in the old town, partly collapsed, according to Petros Vasilakis, a Greek police spokesman for the southern Aegean region.

Dozens more were injured, seven seriously, according to Mr. Vasilakis, who said that some of those affected were Greeks and some were tourists. He added that one man had lost his legs. Military helicopters moved the seriously injured to hospitals on the nearby islands of Rhodes and Crete, and in Athens.

The extent of the damage caused by the earthquake was unclear, but it did not appear to have leveled as many buildings as a similarly strong temblor that hit the island of Lesbos, in the northern Aegean, last month. Apart from the bar that collapsed, the quake on Friday also destroyed a church and a mosque.

Greek television showed footage of deep cracks in roads and damage to Kos’s main port.

According to Greece’s deputy shipping minister, Nektarios Santorinios, it will take three to four days for the port to be functional again. In the meantime, passenger ferries were being diverted to nearby islands. In comments to the Greek television channel Skai, Mr. Santorinios said residential areas had largely been unaffected by the quake, with damage concentrated in and around the old town.