MADRID — A nurse’s aide who was the first person known to have contracted the Ebola virus outside Africa was released from a Madrid hospital on Wednesday, almost a month after she tested positive for the disease.

The nurse’s aide, María Teresa Romero Ramos, read a statement in which she thanked God as well as the medical team that treated her for “giving her back life.” She then left the Carlos III Hospital where she was treated after testing positive for Ebola on Oct. 6.

“We have shown that we have the best health care service in the world,” Ms. Romero said before leaving the hospital. She added that the service was made of “selfless professionals who, despite often working under terrible political management, are capable of making miracles — and I’m one of them.”

Earlier on Wednesday, medical officials said that Ms. Romero had recovered in part because of her strength and immunological system, but also because of the treatments that she received over the past month. They said, however, that it was not possible to determine which factors most contributed to her survival.

The medical team said Ms. Romero was treated with an experimental antiviral drug, Favipiravir, as well as with plasma from a patient who had survived Ebola.

Without being able to compare the results of Ms. Romero’s treatment with those of other Ebola patients, “we cannot say what cured Teresa,” said Dr. Marta Arsuaga, part of the team that treated her, during a televised news conference Wednesday.