RIO DE JANEIRO — Former President Luiz Inácio Lula da Silva of Brazil left prison this weekend to attend the funeral of his 7-year-old grandson, and, while he was out, reiterated to an audience of political leaders and relatives who had gathered to mourn that he is not guilty of corruption and money laundering.

Mr. da Silva, who was jailed in April after receiving a 12-year sentence, was released Saturday morning from a prison in Paraná State. He then flew to São Paulo before taking a helicopter to São Bernardo do Campo, where the funeral took place. He was to be escorted back to his cell Saturday afternoon.

The funeral was the first time Mr. da Silva, popularly known as Lula, has left prison since being jailed. His grandson Arthur Lula da Silva died of meningitis on Friday. A note on Mr. da Silva’s website said he spoke at the funeral.