A man holds a banner reading 'Free Lula', as around 50 people gathered for a demonstration in support of former Brazilian President Luiz Inacio Lula da Silva in Paris, France, Aug. 14, 2018. EPA-EFE FILE/ETIENNE LAURENT

A court in Brazil early on Wednesday upheld the Federal Police's decision to reject a petition by former president Luiz Inacio Lula da Silva to be able to leave prison to attend the funeral of his elder brother.

Lula's lawyers filed a petition in a court in the southern city of Curitiba to allow Lula to travel to Sao Bernardo do Campo district of Sao Paulo to attend the last rites of his brother Genival Inacio da Silva, popularly known as Vava, who died on Tuesday at the age of 79 due to a rare cancer.

Judge Carolina Lebbos ruled that the decision had to be made by the Federal Police superintendent in the state of Parana, Luciano Flores de Lima, who said that it was not possible to "authorize or make possible" Lula's attendance at his brother's burial due to logistical issues.

Lebbos upheld the administrative decision of the officer and rejected the petition of the former president - who has been in prison since Apr. 2018 - citing "concrete logistical impossibility" and the need to "preserve public security and the physical well-being of the prisoner himself."

The judge said that even if it had been possible to overcome the logistical challenge, other factors jeopardized the safety of the prisoner as well as public order.

She said that the arguments presented by the director of the prison establishment were backed by the reasons cited by the Public Prosecutor's Office, including the possibility of widespread riots and protests which could lead to "undesirable clashes and the polarization of actions and ideas."

The verdict said that the court was not insensitive to the nature of the petition filed by the defense, but due to the "interests involved in the present scenario" and the "concrete logistical impossibility," the preservation of public security and the safety of the prisoner prevailed over other concerns.

In a statement, Lula's Worker's Party criticized the decision and said that taking away the right of a citizen to mourn and bury a loved one was one of the "most cruel stands possible."

The statement added that even during the military dictatorship (1964-1985), when Lula was a political prisoner, he was not denied this right and attended the wake of his mother Dona Lindu.

Since April, Lula has been serving a 12-year prison sentence on charges of passive corruption and money laundering and has been housed in a special cell in the Federal Police headquarters in Curitiba, capital of the southern Parana state.