An Egyptian man with a knife stabbed two female tourists to death and wounded another four at a Red Sea resort on Friday, reportedly shouting at Egyptians to get out of the way so he could attack foreigners.

The two women killed were both German and the other victims are believed to be from central and eastern Europe, Egyptian officials said. Two of those injured were reported to be from the Czech Republic.

The attacker swam from a public beach in the coastal town of Hurghada to the Zahabia Hotel and then began a stabbing spree that took him to the neighbouring Sunny Days El Palacio resort.

He was captured as he tried to swim away from the scene. The attacker is in his mid-twenties and his motives for the assault are not clear, the Egyptian interior ministry said. He was armed with a large knife.

An eyewitness told the Masry al-Yom newspaper that the attacker shouted at Egyptian hotel staff to clear a path as he targeted foreigners on the beach. "Go away, I don't want you Egyptians, you are not wanted,” he reportedly shouted.

Islamist attackers sometimes try to ensure that they are only killing foreigners and not Muslims. Egyptian security officials said it was not clear if the attack was ideologically motivated or if the man was mentally disturbed.