New York (CNN) -- New York is implementing a lottery for any couple wishing to marry Sunday, the day the state's same-sex marriage law goes into effect.
The city said has made 764 slots available for Sunday, which would be the highest number of marriages "on any single day in city history," to handle burgeoning demand for marriage licenses and for weddings at city clerk's offices.
"We are going to make history on Sunday, with the eyes of the nation once again turning to New York City," Mayor Michael Bloomberg said in a statement.
"We've done our homework, and it's clear that the number of couples who want to marry on Sunday is more than the city clerk's offices could possibly handle. And the last thing we want is for couples to wait on line for hours and hours, only to walk away upset on what was supposed to be the happiest day of their lives."
The lottery slots available, by borough, are 400 in Manhattan, 112 each in Brooklyn and Queens, 98 in the Bronx and 42 in Staten Island. The lottery guarantees winners access to one of the city clerk's five offices for either opposite-sex or same-sex couples.
It will open for entries at noon Tuesday and will close at noon Thursday. The lottery winners will be notified by e-mail or phone by noon Friday.
"The fairest way to determine who gets the chance to wed on Sunday and ensure everyone can properly plan for their own big day is through an even-handed lottery system. Nobody puts on big events like New York, and we will be ready on Sunday for what will no doubt be an historic and unforgettable moment," Bloomberg said.
As of Tuesday morning, the clerk's office "had received 2,661 online applications since July 5, of which the Clerk has estimated that 1,728 are from same-sex couples."
The city said in a statement that its data "showed that 54 percent of the online applicants planned to visit the Clerk's Office on July 24th for their marriage license; and that 50 percent of the applicants planned to get married at the Clerk's Office that day."
Couples who have registered for the marriage license must enter the lottery if they want to marry Sunday. Those who aren't chosen in the lottery "should plan on visiting a Clerk's office location at a future date," the city said.
"There is no advantage to registering quickly for the lottery -- all applicants who register in time will have an equal opportunity to be randomly selected. There will be a separate lottery for each of the City Clerk's five borough offices and lottery applicants must specify one -- and only one -- office where they wish to marry," the statement said.
The previous highs for weddings in one day were 621 marriages on Valentine's Day 2003 and 610 marriages on August 8, 2008.
New York legalized same-sex marriage in June. The Marriage Equality Act was a priority for Gov. Andrew Cuomo after winning election in November. The law was passed under a Republican-led Senate after days of delays and negotiations between the two parties.
Massachusetts, Connecticut, Iowa, Vermont and New Hampshire also allow same-sex marriage, as does the District of Columbia.