"The District of Columbia handgun ban has failed. It has failed miserably," said Rep. Mark Souder, R-Ind., sponsor of the bill that passed 250-171.
It is unlikely the Senate will take up the measure this year.
Democratic opponents said the vote was timed to force lawmakers into a tough position on gun control ahead of the Nov. 2 election. Fifty-two Democrats voted for lifting the ban and 22 Republicans voted against the bill.
The legislation would lift the ban on handgun ownership. It also would allow people to have other weapons, including semiautomatic rifles, that are not illegal under federal law.
The measure would mean an end to requirements that firearms be registered and that rifles and shotguns kept in people's homes be stored unloaded and disassembled or unlocked.
Souder said he would seek to make clear that people still could not carry firearms on city streets.
Supporters of the measure said the district's laws violate Second Amendment rights to bear arms. The laws "discriminate against the blood-bought right to keep and bear arms that is enshrined in the Constitution," said Rep. Mike Pence, R-Ind.
It was also argued that, with guns readily available in neighboring Virginia and elsewhere, the ban has been ineffective in stopping violence in what Souder and others called "the murder capital of the United States."
But there was strong opposition from city officials and area lawmakers.
Mayor Anthony Williams said the bill was "an insult to the memory of people who died in our city due to gun violence." Metropolitan Police Chief Charles Ramsey said the legislation would lead to a "tidal wave" of more deadly weapons in the hands of criminals.
The district's nonvoting delegate to the House, Eleanor Holmes Norton, said the homicide rate in Washington is approaching a 20-year low, but the rate is rising among juveniles. "This repeal will largely affect kids in the District of Columbia," she said.
Also at issue was whether the bill infringed upon Washington's authority to decide on matters that affect its citizens. Backers of the bill said the city does not have the power to enforce unconstitutional laws. Opponents pointed to court decisions upholding the capital's gun safety laws.
"This is absolutely crazy," said Rep. Carolyn McCarthy, D-N.Y., whose husband was killed and son wounded in 1993 by a gunman on a Long Island Rail Road train.