The lucrative and long-controversial lottery contract has finally passed the D.C. Council.

Intralot, a Greek-owned multinational firm, has been approved to take over the city’s online number games from longtime operator Lottery Technology Enterprises—-a contract worth nearly $40 million over five years. The company’s successful first bid ended in a political fiasco, with several councilmembers refusing to ratify the contract after raising questions about minority partners. A second round of bidding ensued, and Intralot chose to bid without local participation and won again.

But the second round wasn’t without controversy. Two other bidding groups raised questions about the process, and in a council hearing last Tuesday, one of them, organized by Intralot competitor GTECH, detailed various problems getting certified as a local/small/disadvantaged business—-a process that could have changed the outcome of the bidding.

On the dais today, several councilmember raised questions about the award. Council Chairman Vincent C. Gray said called the affair “one of the most reprehensible processes I’ve seen in a long time” and “just a picture of ineptitude.” But he also said that the appearance last week by Intralot and its local partners, Veterans Services Corp., raised his confidence in the contract award.

In the end, only At-Large Councilmember Phil Mendelson voted against the contract, saying on the dais that there is “very good possibility that the fix was in.” Gray and Kwame Brown abstained (Gray’s close friend and former campaign chair Lorraine Green is involved with the GTECH group; it’s unclear why Brown voted as he did). Muriel Bowser of Ward 4 voted present; nine remaining councilmembers voted to approve.

Afterward, former Ward 7 Councilmember Kevin Chavous, who has been lobbying on behalf of Intralot, celebrated the long-coming victory outside the council chambers, along with Emmanuel Bailey, co-owner of Veterans Service Corp., which Intralot intends to contract with to run the lottery.

“This is exciting for the city,” Chavous said, promising that the new operators will up lottery profits for the city and bring new technology and games to the approximately 600 lottery outlets in the city.

But the prospect of a protracted legal battle over the contract award looms. Chavous says that’s “the belly of the best.”

“This is a large contract,” he says. “You’d expect it to be competitive. People are going to fight.”

UPDATE, 3:20 P.M.: Gray and Brown provide some more background on their abstentions. Gray says he didn’t abstain due to his relationship to Green, who was involved in one of the bidding groups. Rather, Gray says, “I abstained because the process was flawed, but I didn’t want to send the message that [Intralot] was unqualified.” Brown provided a similar rationale: “There was just so much going on, it would not have been responsible” to vote to approve. “I was going to vote yes,” he said, “but so much stuff kept coming up.”

Gray explained the willingness of nine councilmembers to vote in approval of such a questionable process this way: “Nobody wants to be in a position of being accused of obstructing additional revenue during this period of tough finances.”

UPDATE, 5:30 P.M.: Bowser adds a similar discomfited note: “I remained uncomfortable with the whole situation. At the same time, we have an incumbent that needs to be replaced.”