Two German tourists have been killed and four other tourists wounded by an attacker with a knife at an Egyptian Red Sea holiday resort.

The motive for the attack is still under investigation, Egypt's Interior Ministry said, adding that the attacker had swum from a nearby public beach to access the holiday resort in Hurghada, some 400km south of Cairo.

The man has since been arrested.

The two tourists were originally identified as Ukrainians, but a security manager of the Red Sea region said that they were from Germany. 

He also said two Czech nationals were among the four people wounded. 

Egypt's security forces are fighting an Islamist insurgency in the Sinai Peninsula and militants have carried out attacks in the past on the tourism industry.

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, security sources said.

Gunmen kill five police officers south of Cairo

Separately today, gunmen ambushed an Egyptian security checkpoint today, opening fire on a car and killing five policemen in an area just south of the capital, the state-run MENA news agency and the Interior Ministry said.

Three gunmen on a motorbike attacked police in the al-Badrasheen area of Giza province, 30km south of Cairo, killing two officers and three conscripts in the latest attack on Egyptian security forces battling an Islamist insurgency.

"A police officer who was near the site of the attack exchanged fire with the assailants forcing them to flee," the ministry statement said.

Witnesses said attackers blasted the vehicle with automatic rifles then took equipment and threw petrol bombs inside the car before fleeing. Residents extinguished the fire.

No group immediately claimed responsibility for the attack.