Police said that three men approached a security barrier at the entrance to the temple complex. When confronted by police, one of the attackers blew himself up. A second was shot dead and a third severely wounded.
"Security forces in Luxor foiled a terrorist operation. Two terrorists were killed and a third was wounded," the police said in a statement.
The attackers, armed with weapons and bombs, were trying to enter the Karnak temple which is the second largest ancient religious site in the world and is frequented by millions of foreign and Egyptian tourists every year.
Luxor is home to some of Egypt's most famous ancient temples and pharaonic tombs, including that of King Tutankhamun. Karnak temple in central Luxor was built on the ruins of Thebes, the capital of ancient Egypt.
The temple covers more than 247 acres and is one of the largest religious complexes in the world. It is the second most visited tourist attraction in Egypt after the pyramids at Giza.
The attack comes a week after two police officers were shot dead by gunmen on a road leading to the Great Pyramids of Giza, west of capital Cairo.
The attacks targeting police and military increased after the ouster of ex-president Mohamed Morsi in 2013. But shooting at tourist sites are rare incidents.
