No more punch-card voting machines like those that are blamed for the 2000 presidential election mess.

House and Senate negotiators have agreed to help states replace those machines and to require new identification requirements for voters who register by mail.

"Almost two years from the 2000 elections, this legislation will help America move beyond the days of hanging chads, butterfly ballots and illegal purges of qualified voters," said Sen. Chris Dodd of Connecticut, the Senate's chief Democratic negotiator.

Rep. Robert Ney of Ohio, his Republican counterpart in the House, said the measure will "produce elections that leave no one behind."

The total cost of the bill is just over $3.8 billion, and is expected to pass both chambers before they adjourn for the November election.  The changes will not be instituted until the 2004 election.

Lawmakers worked all night to reach the deal Friday. The election overhaul bill had been trapped for months by partisan bickering over enforcement and identification provisions in the bill.

The compromise requires voters who register by mail to show identification when they go vote, said Senate aides who asked not to be named.  Republicans had demanded the language to prevent fraud, but Democrats had balked, saying it would discriminate against poor and minorities.

The compromise allows photo IDs, utility bills or other documents to suffice as identification.

The agreement allows the Justice Department to sue states that violate voting rights rather than individuals, as Democrats had sought. States will be directed to establish a grievance procedure for alleged voting violations, however.

The compromise was reached in part over frustration following Florida's Democratic primary last month in which a recount because of machine errors delayed the outcome of the Democratic gubernatorial nomination process.

That delay came after Florida had already purchased new voting machines to prevent a repeat of the presidential election two years ago, which was sent to the Supreme Court for a decision.

Maine Secretary of State Dan Gwadosky, president of the National Association of Secretaries of State said, the attorneys general thought it best to urge Congress to act in time before the next presidential election to prevent another fiasco like in Florida.

"The timeliness is becoming really important now," Gwadosky said.

The Associated Press contributed to this report.