CAIRO -- Two female tourists were stabbed to death while four other foreigners were wounded in an attack Friday at a hotel in the Egyptian Red Sea resort of Hurghada, an Egyptian security official said.

Two German tourists were stabbed to death, a health ministry source told CBS News' Ahmed Shawkat. One of the injured has gone under surgery and three others were treated at nearby hospitals, the source said.

Egypt's Interior Ministry said the assailant was arrested immediately after the stabbings. An initial investigation showed he had sneaked into a hotel by swimming from a nearby beach and attacked the tourists. The motive for his attack was not known.

Two of the wounded tourists were Czech female nationals, the Reuters news agency reports. The nationality of the two other victims have not been confirmed.

Get Breaking News Delivered to Your Inbox

An Egyptian security official described the attacker as a young man in his twenties, dressed in a black T-shirt and blue jeans, and said he shouted in Arabic during the attack, apparently meant for Egyptians: "Stay away, I don't want Egyptians."

Earlier on Friday, gunmen riding a motorcycle opened fire on a security vehicle patrolling a Giza village, next to some of Egypt's oldest pyramids outside the capital, Cairo, killing five police, the Interior Ministry and officials said.

The deadly shooting -- on the Muslim weekend in Egypt, when traffic is slower -- heightened fears of what has become near-weekly attacks by suspected Islamic militants after a blitz attack left 23 troops dead in northern Sinai a week ago.

A Google Map shows the location of the Red Sea resort Hurghada, with a red marker, on the east coast of Egypt. Google Maps

Egypt has been under a months-long state of emergency following a series of deadly church bombings in the spring. Friday's attacks threaten a new blow to the country's struggling tourism industry and economy.

The village of Abusir in Badrashin, where the policemen were killed, is part of Greater Cairo. The policemen were part of the force tasked to guard the district of Saqqara, one of Egypt's most popular tourist sites and host to a collection of temples, tombs and funerary complexes.

According to the ministry, the militants sprayed the policemen's vehicle with machine-gun fire and fled the scene after one policeman returned gunfire.

Egyptian security officials had earlier said that the attackers were masked and that they had targeted a checkpoint. The assailants stole the policemen's weapons and radios and tried to set fire to the bodies but fled upon seeing people gathering nearby, witnesses said.

The witnesses also spoke on condition of anonymity, fearing for their own safety. The disparate accounts could not immediately be reconciled.

CBC Extra, a privately owned Egyptian TV network, said surveillance cameras at a gas station nearby showed the attackers disguised in police uniforms and that they stopped the police vehicle before opening fire. It wasn't immediately possible to confirm the network's account.

Authorities cordoned off the area and ambulances rushed to the site, located near the famous Step Pyramid of King Djoser. It is the oldest of Egypt's more than 90 pyramids and the forerunner of the more familiar straight-sided pyramids in Giza on the outskirts of Cairo.

The Hasm, or "Decisiveness," is a militant group that authorities have linked to the now-outlawed Muslim Brotherhood. It has claimed responsibility for drive-by shootings and attacks that targeted police, military, judges and pro-government figures in the past.

Last week, Islamic militants killed 23 army personnel in a remote checkpoint in northeastern Sinai Peninsula. The IS in Egypt claimed responsibility for that attack - the deadliest in the turbulent region in two years.

Egypt has been under a state of emergency since April, after suicide bombers struck two Coptic churches north of Cairo, killing scores of Christians.

Egypt has been rocked with deadly suicide bombings and drive-by shootings since the 2013 military ouster of an elected Islamist president. The violence has been concentrated in the northern Sinai Peninsula, but attacks have spread to the mainland, including in the capital, where suicide bombers have struck churches and security headquarters.

The Brotherhood won a series of elections in Egypt following the 2011 uprising that toppled longtime autocrat Hosni Mubarak. Mohammed Morsi, a senior Brotherhood leader, became Egypt's first freely elected president the following year.

His brief rule proved divisive, and the military overthrew him in 2013. Authorities outlawed the Brotherhood a few months later, declaring it a terrorist group. An ensuing security crackdown on the group's ranks battered its leadership, who are either in prison or exile, and its youth became potential recruits for militant groups.

In January, 2016, two suspected militants stabbed and wounded three foreign tourists -- two Austrians and a Swede -- at a hotel in Hurghada.

Security forces opened fire at the two assailants, killing one and seriously wounding the other in that attack. Officials said the two men armed with knives had entered the hotel's outdoor restaurant at the front of the building and attacked the tourists.