Afrofest will get a two-day permit from the city after all, a decision reached after the music festival's fans blasted the city on social media for what they perceived as unfair treatment.

The city had planned to trim the Woodbine Park festival back to one day this year due to reports of noise violations and the installation of a second stage that wasn't permitted. Music Africa, which organizes the 27-year-old event, called that decision "completely unfair and discriminatory"

Coun. Mary-Margaret McMahon, whose ward includes Woodbine Park, was also criticized on social media for her suggestion that the event's organizers need to "behave."

On Wednesday, McMahon announced that following a meeting with the organizers and Mayor John Tory, the city had agreed to a two-day festival.

"All parties are committed to working together to ensure Afrofest is successful this summer and in future years," McMahon and Music Africa president Peter Toh said in a joint news release.

Music Africa, the release said, admits to violating some permits. The city, meanwhile, said it had "unclear communication" surrounding the permits.

In 2011, the city refused to grant Afrofest a permit to use Queen's Park — where it had been staged for the previous 23 years — saying the festival was too big and had violated the terms of its permits in the past.

McMahon said the Toronto Music Advisory Council will also be involved in this year's festival to lend expertise.

Afrofest is set for July 9-10 at Woodbine Park and is set to draw some 120,000 people throughout the weekend.