The deadline for registering to vote in the EU referendum has been extended to the end of Thursday, the government has said.

The move - requiring emergency legislation - came after thousands of people were prevented from registering by the original deadline of midnight on Tuesday when a government website crashed.

Cabinet Office minister Matt Hancock said: "Following discussions with the Electoral Commission and strong cross-party support expressed in the House of Commons, we will introduce secondary legislation to extend the deadline for voter registration until midnight tomorrow.

"Having taken the decision today, we think it is right to extend to midnight tomorrow to allow people who have not yet registered time to get the message that registration is still open and get themselves registered."

Brexit campaigners accused the government of trying to "skew" the result of the referendum by extending the deadline.

The chief executive of the Vote Leave campaign, Matthew Elliott, said the government was "trying to register as many likely Remain voters as possible" amid speculation that thousands of those prevented from registering were younger people who are thought to be more likely to back EU membership.

In a message to supporters, Mr Elliott urged them to get Brexit-backing friends and family to apply for a vote, with the message: "Don't let the government skew the result of the referendum - make sure you and your friends are all registered today."

Downing Street said 214,000 people were trying to use the www.gov.uk/register-to-vote website between 9pm and 10pm on Tuesday, but it was not known how many were prevented by the system overload from registering before the midnight deadline.

Amid demands from senior figures including Labour leader Jeremy Corbyn, Liberal Democrat chief Tim Farron and Green leader Natalie Bennett for a deadline extension, ministers went into urgent talks with the Electoral Commission over possible legislative action to allow late applicants to vote.

And Prime Minister David Cameron urged people to keep on registering while the situation was sorted out.

In a message on Twitter, he said: "If you aren't registered and you want to vote in this EU referendum you should continue to register at gov.uk/register-to-vote.

"Huge demand caused system overload last night. Urgent discussions with Electoral Commission to try to ensure people who register can vote."

Alex Robertson, director of communications at the Electoral Commission, said: "No-one should miss out on voting in this historic referendum because of the problem with the Government's registration website last night. We said this morning that legislation should be introduced to extend the registration deadline and we're pleased the Government will now be making this change.

"We are urging everyone who is not already registered to vote to take this last chance to do so before the end of Thursday."