The Government backed a proposal to guarantee general election votes are counted on polling night.
Justice Secretary Jack Straw said last night the Government would support a Tory amendment to the Constitutional Reform and Governance Bill requiring vote-counting to start within four hours of the polls closing, and would allow Labour MPs a free vote on the issue.
The move, backed without a vote, comes amid fears voters could wake up the day after an election not knowing who won, after increasing numbers of local authorities indicated they intend to delay counts until the following morning.
Individual returning officers currently choose when counts will be held, according to local circumstances.
A Commons motion to save election night counts was signed by more than 200 MPs, and a similar Facebook group attracted over 6,000 members.
The Tory amendment requires the counting of votes in parliamentary elections to start "within four hours of the close of the poll, save in exceptional circumstances".
The Electoral Commission will be consulted on what should constitute "exceptional circumstances".
Shadow justice minister Eleanor Laing earlier pressed ministers to accept the amendment "to make sure that election night is not lost and democracy is preserved".
Mr Straw said the move would send a "clear message to electoral registration officers about the intent across all sides of the House".
Ms Laing welcomed the Government's announcement, congratulating Mr Straw on his "courage".
But former Tory MP, now Independent, Andrew Pelling (Croydon Central), said: "It's not right in a parliamentary democracy that counting takes place when people are half awake.
"Surely it is not a great issue as to whether or not counts take place in the morning or overnight."
Mr Straw said the new clause only provided that counting should begin within four hours of the close of the poll. In the case of a recount, counting could be suspended until the following day.
"Concern has been expressed on all sides of the House about a growing trend by electoral returning officers, for their own convenience and nobody else's, to defer the counting of most of the constituencies, which have always been counted in the past on the night of the election, until the following day," he said.
Commenting later in a statement, Ms Laing said: "Postponing election counts until the next day would have sucked all the excitement and drama out of general election night. We welcome the fact that the Government has listened to the campaign we have waged on this issue."
Conservative party chairman Eric Pickles added: "This is a great victory for common sense and the voting public.
"I applaud Jonathan Isaby and Conservativehome for the tenacious way they have supported the cross-party campaign.
"Given the massive cross-party support for saving general election night, it is vital that any clarified law does not fall because of disputes over more controversial aspects of the Bill.
"Subject to the will of Parliament, the Electoral Commission should now take urgent steps to issue new guidance to electoral returning officers to prepare for overnight counts."
Mr Isaby, co-founder of the Save General Election Night Campaign and co-editor of Conservativehome, said: "I am delighted that what started as an internet-based campaign last autumn has finally borne fruit and that general election night appears to have been saved.
"We have argued throughout that overnight counting is absolutely vital to retaining interest and faith in the democratic process.
"I would like to pay tribute to all those who have blogged in favour of the campaign, not least Labour MP Tom Harris who also tabled the 220-strong Commons motion on the issue, and Mark Pack of Lib Dem Voice.
"It is great to see commonsense prevailing on the back of a campaign which won high-level cross-party support, including backing from Conservative chairman Eric Pickles, Speaker John Bercow, and now the Justice Secretary himself, Jack Straw."Reuse content