But after the protest in Cannes, Brazil’s Justice Ministry gave “Aquarius” a rare 18-plus rating (not recommended for anyone under 18), citing scenes of sex and drug use. After critics called that decision retaliatory, pointing out that other films with explicit sex scenes had received more lenient ratings, the authorities changed their minds and gave “Aquarius” a 16-plus rating.
The fight hardly ended there. Prominent figures in Brazil’s film industry then expressed concern when the Ministry of Culture named Marcos Petrucelli, a critic who has been challenging the political views of Kleber Mendonça Filho, the director of “Aquarius,” to the committee selecting the Oscar nominee.
To support “Aquarius,” three Brazilian directors withdrew their own well-regarded films from consideration by the Oscar committee, and a director and an actor on the committee stepped down from their posts.
Entering the fray, leading conservative commentators began eviscerating “Aquarius” and its supporters. Calling the director a “petralha,” a slur commonly used to insult leftists in Brazil, Reinaldo Azevedo, an influential columnist and radio commentator, said, “The duty of people with goodness in them is to boycott ‘Aquarius.’”
The producers of “Aquarius” simply took the suggestion and plastered it on advertisements for the film, stoking the fire for marketing purposes. In theaters across Brazil, audiences have been shouting, “Out with Temer,” at the culmination of “Aquarius,” which is emerging as a box-office hit.
“In an intense way, all the retaliation against ‘Aquarius’ is backfiring,” said Mr. Mendonça Filho, the director. He compared the passions around “Aquarius” to those involving “Network,” the 1976 film about broadcast news in the era of Watergate, in which an anchor persuades his viewers to shout out their windows, “I’m as mad as hell and I’m not going to take this anymore!”
Suddenly “Aquarius” has also become a catalyst for expressing outrage in a recession-weary country troubled by corruption scandals. Demonstrators are now hounding the new culture minister, Marcelo Calero, after he asserted that the antigovernment protest in Cannes had debased Brazil’s image abroad.
At two Brazilian film festivals where “Aquarius” was screened in recent weeks — in the cities of Gramado and Petrópolis — members of the audience denounced Mr. Calero as a “golpista,” or putschist. In Petrópolis, Mr. Calero and protesters engaged in a venomous shouting match captured on video and shared widely on social media.
Carlos Andreazza, a publisher who works with conservative authors, asserted that the controversy surrounding “Aquarius” was also revealing intolerance among leftists toward those with different views.
In a column in the newspaper O Globo, he wrote that Brazil was becoming a country in which someone criticizing a Workers’ Party sympathizer automatically risked being branded a “scoundrel or a putschist.” “This has a name: fascism,” Mr. Andreazza wrote.
Some fans of “Aquarius” worry that the discord is distracting attention from the film’s attributes. The director’s debut feature, “Neighboring Sounds,” which was Brazil’s submission in 2012 for the Oscars, also dealt with class tensions by focusing on ways in which masters and servants related to one another on a single block in Recife.
“Aquarius,” while also touching on such tension, goes further by exploring the model of urban development prevailing in cities across Brazil, where construction magnates operate largely with impunity. Razing architectural gems, they erect mediocre apartment towers that contribute to traffic congestion and the isolation of the middle class behind high walls.
Ms. Braga, 66, plays Clara, a retired music writer, refusing to budge when developers try to buy her out of her Art Deco apartment. They resort to tactics like smearing the hallways of her building with excrement and using an empty neighboring apartment for an orgy, setting off a series of reactions by Clara.
The film dovetails with the simmering anger in Brazil over the construction giants at the center of the graft scandals engulfing the political establishment. But Bruno Barreto, the director who presided over the Oscar committee, said the panel was not under pressure from Mr. Temer’s government to vote against “Aquarius.”
In explaining the selection, Mr. Barreto, 61, who directed the 1976 film “Dona Flor and Her Two Husbands,” which also featured Ms. Braga in a starring role, told reporters that the committee “had to choose a film that’s not necessarily the best, but that has the profile of the Academy of Hollywood, which is made up of older people.”
For his part, David Schurmann, the director of “Little Secret,” which will represent Brazil at the Oscars even though it is not expected to be nationally released until November, said he liked “Aquarius” to the point of giving it a standing ovation in Cannes.
“I entirely understand the controversy,” he told reporters. “But ‘Little Secret’ is more fitting for the Oscar.”
Others in Brazil’s film industry beg to differ, arguing that it’s clear “Aquarius” was a victim of the government’s shift to the right.
“The committee’s selection process was opaque to the point of making it illegitimate,” said Gabriel Mascaro, one of the directors who withdrew their films from consideration by the Oscar panel this year. “It’s a shame, but this is indicative of the political moment we’re now enduring in Brazil.”