CAIRO — Two German tourists were killed and four other tourists were wounded at a Red Sea resort on Friday when an assailant swam up to a beach and stabbed them repeatedly with a knife, Egyptian officials and hospital workers said.

All of the victims were women.

The attack, which took place in Hurghada, 250 miles south of Cairo, was the first significant attack on foreigners in Egypt in more than a year. It came at a time when the country’s battered tourism industry, a vital source of foreign currency, was starting to see a modest revival.

The assailant reached the resort by swimming from a nearby public beach, the Interior Ministry said in a statement. Witnesses described him as a man in his 20s, wearing jeans and a black T-shirt, and said that he shouted in Arabic that he did not want to attack Egyptians.

After stabbing four women at one resort, including two Germans in their 60s who later died, the man swam to an adjacent beach, where he attacked two more women.