A university in New York has made a public apology after accidentally sending more than 5,000 prospective students letters of acceptance.

In a statement on its website, the University at Buffalo (UB) said it “sincerely regrets” the error as well as “any stress” it may have caused students and families who received the letters.

According to local news site The Buffalo News, the blunder may be the “biggest ever” to have affected a higher education institution with the accidental email landing in 5,109 inboxes - or around a fifth of all UB applicants.

Highlighting how the error occurred, the university said an incorrect email list was generated from an applicant database, adding: “Within three to four hours following the discovery of this error, the university emailed a letter of explanation to the recipients, offering its sincerest apologies to those who were affected.”

The university’s enrolment management department is said to have taken “immediate steps” to ensure that errors of this kind will not occur in the future, said the statement.

The top 10 universities in the world Show all 10 1 /10 The top 10 universities in the world The top 10 universities in the world 1. California Institute of Technology The top 10 universities in the world 2. University of Oxford The top 10 universities in the world 3. Stanford University The top 10 universities in the world 4. University of Cambridge The top 10 universities in the world 5. Massachusetts Institute of Technology The top 10 universities in the world 6. Harvard University The top 10 universities in the world 7. Princeton University The top 10 universities in the world 8. Imperial College London The top 10 universities in the world 9. ETH Zürich – Swiss Federal Institute of Technology Zurich The top 10 universities in the world 10. University of Chicago

UB added: “We know that this can be a stressful time for prospective students and their families. The University at Buffalo deeply regrets this unfortunate error in communication.”

One of the affected students told The Buffalo News she was “ecstatic” to have received an offer and preceded to tell family and friends - only for the offer to then be revoked after which she felt “embarrassed” at having to backtrack on her good news.

The student’s mother described it as “winning the lottery, then getting a letter saying, ‘Wrong ticket’.”

However, there may be a light at the end of the tunnel for some of the letter’s recipients. The university concluded in its statement: “It is important to note that the admissions applications of this group of students are still under review and the students are still being considered for acceptance by the university.”

UB says it is a research-intensive public university dedicated to academic excellence, adding: “Our thinking, research, creative activity, and people positively impact the world.” For the 2014/15 academic year, it took on almost 30,000 students.

The technical error isn’t the first to affect a major university in the US. The Buffalo News reports that, in 2014, Johns Hopkins University in Maryland sent 300 offers to students it had earlier told they would not get in.