RIO DE JANEIRO — President Jair Bolsonaro of Brazil, hospitalized late last month for a procedure related to a stabbing during a September campaign rally, remained in a semi-intensive care unit in São Paulo on Thursday with signs of a possible pneumonia infection.

The Albert Einstein hospital said in a statement that it had carried out tests on Mr. Bolsonaro after an isolated episode of fever Wednesday night.

“He underwent a tomography of the chest and abdomen that showed a good evolution of the intestinal frame and images compatible with pneumonia,” the hospital said.

Doctors said that Mr. Bolsonaro was not eating solid foods. He is doing walking exercises and is in no pain, they added.