Tourists walk on the Giftun Island beach as the sun sets over the Red Sea in Hurghada, Egypt. Six foreign tourists, of various nationalities, were wounded when a man attacked them with a knife in the Red Sea resort of Hurghada. File picture: Hassan Ammar/AP

Cairo - An attacker armed with a knife killed two female German tourists and wounded four other foreigners, including two Czechs, at an Egyptian Red Sea beach resort on Friday, local authorities and sources said.

The attacker swam from a nearby public beach to access the Zahabia Hotel, where he killed the two Germans and wounded two others before attacking two more people at the adjacent Sunny Days El Palacio resort in Hurghada, security sources said.

Security and medical sources had earlier reported the two women killed were Ukrainians, but Major Gen. Mohamed El-Hamzawi, security manager of Red Sea province, told Reuters the two victims had been identified as Germans.

The interior ministry said the attacker was arrested after the attack, but the motive was still under investigation.

Egypt is fighting an Islamist insurgency in the Sinai Peninsula where they mainly target security forces, but militants have previously attacked tourism targets and have also hit Coptic Christians and churches.

The nationality of the two other victims, who were also taken to hospital, was not immediately known. A spokesman for the Czech foreign ministry confirmed one Czech female national was wounded in the attack.

The Zahabia and El Palacio hotels in Hurghada, one of Egypt's most popular holiday resorts, some 400 km (250 miles) south of the capital Cairo, both have their own private beach.

In January 2016, two assailants armed with a gun, a knife and a suicide belt landed on the beach of a hotel in Hurghada, wounding two foreign tourists.

Friday's attack came on a day that five policemen were killed by gunmen on a motorbike who ambushed their car just south of Cairo.