Boris Johnson is on the verge of offering Tottenham Hotspur FC millions of pounds in assistance to remain in their north London home and help regenerate the area after the recent riots.

But the north London club has also won permission in the high court for a judicial review of the decision to award the Olympic stadium in Stratford to a joint bid from Newham council and West Ham United.

A full hearing will take place on 18 October after Mr Justice Collins overturned an earlier ruling and agreed Spurs had an "arguable case" on claims that the east London council fell foul of EU state aid rules in loaning £40m to West Ham to complete conversion work on the stadium.

The news came hours after City Hall sources confirmed that an agreement was close on a package of measures to make White Hart Lane in Haringey, where the Spurs ground is located, a cornerstone of plans to regenerate the riot-hit area and subsidise the redevelopment. But they stressed the offer was not contingent on Spurs dropping the legal action, despite speculation to the contrary.

A spokesman for the London mayor said: "We have had constructive negotiations with Tottenham Hotspur and Haringey council. We are hopeful a deal can be reached on building a new stadium on the current site so the mayor can accomplish his long-term ambition to regenerate a much wider area in this neglected and impoverished part of London."

Johnson's plan faces the prospect of protests about handing public money to a Premier League club.

It is understood that the package includes a contribution of about £8.5m towards the regeneration of the "public realm" around the stadium, a sum that could increase as plans are advanced. It will come from a £50m fund put together by Johnson in the wake of the riots to regenerate affected areas, including £20m from central government to be invested specifically in Tottenham and Croydon. Haringey council is believed to have substantially relaxed planning restrictions in a bid to get the scheme off the ground. Spurs had originally prepared plans for the £450m redevelopment of the stadium as their first option but, in the face of delays and escalating costs, turned to Stratford.

When the Olympic Park Legacy Company ruled that West Ham's bid, which proposed to retain the athletics track, should be chosen over the Spurs proposal, they criticised the process and launched the legal action.

Lawyers acting for Spurs were given permission by the judge to apply to make the recent controversy over an OPLC employee, who was also paid by West Ham during the bidding process, a factor in their case.

Independent investigations by both parties found that OPLC director of corporate affairs Dionne Knight, who was paid £25,000 by West Ham for consultancy work unbeknown to her employers, had no effect on the bidding process.

The high court decision strengthens Spurs' negotiating hand with the mayor and reduces West Ham's chances of being able to move into the stadium in time, for the 2014-15 season. It could also be hugely embarrassing for the OPLC and the government, with major implications for the legacy from the Olympics, if they are ultimately forced to re-tender for the stadium.

"We are delighted that Mr Justice Collins upheld all grounds relating to the Olympic Park Legacy Company's decision-making process when recommending a preferred bidder," said OPLC chair Margaret Ford.

"We are disappointed that permission for a judicial review has been granted on some limited points but we are confident in our case."