The first-ever bid by an off-track betting corporation to operate a racetrack in New York state was, after three years of lobbying, given final approval Thursday in the state legislature.Western Regional Off-Track Betting Corp., which controls wagering in a huge, 15-county region in upstate New York, will be allowed to run harness races at Batavia Downs, which is located east of Buffalo. It is the first time an OTB corporation, which in New York are quasi-public agencies, will be permitted to operate a racetrack.Critics have said the measure sets a bad precedent by letting a government-connected organization compete with privatized racetracks. Western OTB gave some track operators hundreds of thousands of dollars in concessions to end their opposition.Gov. George Pataki must sign the legislation. Batavia Downs, which hasn't raced in years, also needs a license from the state Racing and Wagering Board. Both approvals are expected.It is unclear when racing would begin again at the track. OTB officials did not return calls for comment, but they recently told lawmakers it would be all but impossible to get racing under way this summer, as planned, because the measure had been held up again for six months in the face of intense opposition by other tracks.The OTB corporation bought the track in 1998 for $2.5 million after state regulators closed the facility when its previous owners ran into financial problems. Western OTB has become especially interested in getting the track running in hopes of piggybacking on to efforts by other tracks in New York that want video lottery terminals. That campaign, lobbyists say, gained steam this week after Pataki announced a deal with an Indian tribe to bring three casinos to western New York.The Batavia Downs plan had opponents until the very end. "It's a bad idea putting an OTB (corporation) in charge of a racetrack," said Sen. William Stachowski, a Democrat and one of 13 senators to vote against the measure Thursday night.Batavia Downs opened in 1940 and was the oldest nighttime pari-mutuel track in North America before it closed.