A suicide bomber has blown himself up close to the ancient pharaonic temple of Karnak in southern Egypt, a site visited by millions of tourists every year.
No tourists were killed or hurt in the attack and the Nile-side monument sustained no damage, the government confirmed.
The attack was the second this month near a major tourist attraction in Egypt, marking and a shift in tactics in a campaign of violence waged by Islamic militants against the government of President Abdel-Fattah el-Sissi.
The attacks suggest extremists are shifting from their focus on shootings and bombings against security forces to targeting Egypt's vital tourism industry.
A sustained campaign would threaten to wreck an industry that has long been a main revenue earner for Egypt and is only just beginning to recover from the country's turmoil since 2011.
On June 3, gunmen on a motorcycle opened fire outside the famed Giza Pyramids on the outskirts of Cairo, killing two police officers.
In the latest attack in the southern city of Luxor, officials said security at Karnak thwarted what would have been a worse attack, by preventing the suicide bomber from entering the temple complex and battling two gunmen who were with him, killing one and capturing the other.
Karnak is one of Egypt's biggest tourist draws, a giant complex of temples, colossal statues, obelisks and massive columns built by a succession of pharaonic dynasties. The oldest sections date back nearly 4,000 years.
Mohammed Sayed Badr, the governor of Luxor province, said that the attack was "an attempt to break into the temple of Karnak".
"They didn't make it in," he said.
Mr Badr said three men carrying bags got out of a car in the temple's car park, which immediately made the police suspicious.
One of the three began running when police ordered them to stop, so the police fired at him and an explosive belt he was wearing blew up.
The Tourism Ministry said in a statement that the man detonated his "explosive device", killing himself instantly.
A second man had a gun and started shooting at the police before he was shot and killed. The third attacker was wounded in the shootout and arrested, Mr Badr said.
Four others were wounded in the exchange of fire, including two policemen and a member of staff at the site, according to the Interior Ministry, which is in charge of police.
Mr Badr said the nationalities of the three attackers have yet to be determined.
There were only a handful of tourists and Egyptians inside the temple at the time of the attack, security officials said.