Formula E, which runs the races, made the decision after the Battersea Park Action Group began a court action against Wandsworth Council, challenging its right to rent the park out for the race.
The races were first held in 2015 despite strong opposition from many local residents.
The campaign group's court action for judicial review was lodged in April and was to be heard in the High Court on 24-25 May, between the claimant James Jackson and defendant Wandsworth Council, with Formula E as an interested party.
However that action has been withdrawn after an agreement was reached over the future use of Battersea Park.
The championship on 2-3 July will go ahead this year but organisers will look for other sites for future years.
As required under the planning conditions for this year's event, the park will be reinstated by Formula E to its original pre-March 2015 condition.
Wandsworth Council had previously said £1m would be invested back into Battersea Park if the races were held for five years as originally planned.
Council community services spokesman Cllr Jonathan Cook said: "We have secured a financial agreement with Formula E which includes a compensation package for loss of income in 2017. This means that the total amount the council will receive from Formula E for staging these racing events in the park has reached £2.85m.
"Some of this money has been spent on maintaining and improving Battersea Park, while the rest is helping to fund the vital frontline services that our residents rely on the most like services for vulnerable children, libraries, day centres for older people, support for disability groups and other important functions like fixing potholes and keeping our streets clean."
Cook said he was proud the council had brought the event to London, adding: "This council will continue to make sure that Battersea and all our other parks are used in ways which can benefit all our residents."
Campaigner James Jackson said he felt the settlement represented a favourable outcome for all parties involved, given the preparations already in hand for this year's races as well as the obligation to reinstate the park.
He said: "I am delighted that a solution has been found; this is good for everyone."
The Open Spaces Society welcomed the announcement, saying it "deplores the abuse of the park for a substantial commercial event".
General secretary Kate Ashbrook said: "We congratulate Mr Jackson and the Action Group on achieving this result which will ensure that the park is protected in future, as befits a Victorian, grade II*-listed site. However, we are sorry that the legal challenges were not tested in court.
"We maintained that this event would be unlawful, as it contravenes the Greater London Parks and Open Spaces Order 1967 which outlaws such events where they occupy more than one-tenth of the open space. There are other events occurring in London which we also believe to be contrary to this legislation, and we are ready to issue a legal challenge if we consider a common, park or open space to be at risk."