Accompanied by a barrage of rocks, the shooting underlined the mounting tensions over Egypt's construction of an underground steel wall that could seal Gaza's southern border, block hundreds of smuggling tunnels and deprive Gaza's Hamas rulers of their only lifeline.
Hamas is trying to rally Arab and Muslim public opinion against the barrier it has dubbed the "death wall." Hamas-allied Muslim clerics have denounced the wall as "haram," or forbidden by Islam, and protesters picketed Egyptian embassies in Lebanon and Jordan this week.
Egypt, meanwhile, is adopting an increasingly defiant stance, saying that securing along its border with Gaza is a matter of national security. In the past, Egypt had been less unequivocal and tried to play down its role, alongside Israel, in enforcing Gaza's border blockade
Wednesday's clashes began when several hundred Hamas supporters waving green Hamas flags marched toward Egyptian border fortifications to protest against the wall construction and Egyptian restrictions on an international aid convoy led by British legislator George Galloway.
A senior Hamas official, Munir al-Masri, told the protesters that Egypt's actions were shameful. Moments later, people in the crowd started to throw rocks at Egyptian border guards, including an Egyptian position fortified with sandbags.
At some point, Hamas police fired shots to disperse the crowd and shots were also heard from the Egyptian side of the border. It was not clear who fired first.
Gunshots killed a 21-year-old Egyptian border guard stationed in a watch tower, according to the Egyptian news agency. Seven Palestinians were also hit by gunfire, including three who were seriously wounded, Palestinian hospital doctors said.
Nine Egyptian guards and eight Gaza protesters were hurt by rocks and tear gas.
It was the worst violence on the border since an Egyptian major was killed by Palestinian gunmen during Israel's offensive on the Gaza Strip in December 2008.
Israel, meanwhile, said it has successfully completed testing its "Iron Dome" system to shoot down rockets fired from Gaza or Lebanon.
Israel's devastating invasion of Gaza a year ago was aimed at stopping years of rocket fire. The Israelis say the new system can intercept rockets before they cross into Israeli airspace. The Israeli Defense Ministry did not say when it will be deployed.
Gaza's borders have been frequent points of friction since Israel and Egypt imposed a blockade in June 2006, following the capture of an Israeli soldier by Hamas-allied militants.
The closure was tightened after Hamas overran Gaza a year later, seizing the territory from Western-backed Palestinian President Mahmoud Abbas. Israel says the blockade is meant to pressure Hamas and prevent raw materials from reaching militants, while it allows limited humanitarian supplies into the territory.
The tunnels along the border with Egypt bring in commercial goods, as well as cash and weapons for Hamas. They soften the hardship of the blockade and help Hamas stay in power.
Egypt has tried in the past to curb the illicit trade, including by blowing up tunnels, but the construction of the underground wall marks its highest-profile attempt yet.
Hamas has stepped up weapons smuggling since Israel's withdrawal from Gaza in 2005, and Egypt is increasingly concerned about an influx of Islamic militants from Gaza.
Ehab Hussein, a spokesman for Gaza's Interior Ministry, said growing anger over the underground barrier fueled Wednesday's protests.
"The people's protest on the Egyptian border was ... a natural reaction to the steel wall and to the policy of cutting the arteries of life," he said.
However, Egypt says securing the border is a top priority, brushing aside international protests against the blockade. "This used to matter before, and we were sensitive to criticism. Now, this is the way it will be," said Egyptian Foreign Ministry spokesman Hossam Zaki.
The international aid convoy of more than 500 activists, led by Galloway, entered Gaza from Egypt late Wednesday after a month on the road. The convoy was organized by the Britain-based group Viva Palestina, which planned to deliver hundreds of tons of aid in 200 vehicles.
On Tuesday, Egypt told the activists that 45 vehicles would have to stay behind. Clashes erupted between members of the convoy and Egyptian riot police in the Egyptian Mediterranean port city of El-Arish, and dozens of protesters and police were injured.
At a news conference on the Gaza side of the border late Wednesday, Galloway said that 55 members of the group reached Gaza "bandaged, bleeding and bruised ... because they tried to bring medicine to the Palestinian people under siege in Gaza."
Wearing a black-and-white checkered scarf, a symbol of Palestinian nationalism, he said that "all the free people in the world are wearing these colors, all the free people in the world are crying out for Palestine."