Mexico’s president said Thursday he is creating a central national purchasing and distribution agency for medicines, vaccines and medical equipment amid persistent shortages during the coronavirus pandemic and the arrest of a doctor who advised a patient's family to buy their own medications.

The government has previously done some bulk purchasing, but often contracted out drug acquisition and distribution to private firms. The centralized agency will have a budget of about $2.25 billion over the next two years, and will begin operating Aug. 15. The plan will also presumably apply to any coronavirus vaccine.

There have been repeated reports during the pandemic, and before it, of families being told by doctors to buy medications for their sick relatives because hospitals don’t have them, even though treatment was theoretically free and stocks supposedly existed.

Shortages of everything from drugs to equipment and personal protective equipment has resulted in demonstrations and protests by doctors and patients' families, and this week resulted in the arrest of a doctor in the southern state of Chiapas for alleged abuse of authority, despite the fact his family said he was just trying to get needed medications for a patient.

The arrest of Dr. Gerardo Grajales Yuca brought to the forefront the often perilous position of health care professionals in Mexico's underfunded, overwhelmed health system. Dozens of health care workers have been verbally abused or physically attacked in Mexico during the pandemic by people who associated them with the disease.

Dozens of Grajales Yuca's colleagues marched in the Chiapas capital of Tuxtla Gutierrez Tuesday with a banner demanding “freedom for a doctor who has risked his life caring for patients during the pandemic.”

The Chiapas state prosecutors' office said in a statement that the doctor “asked the person who filed the complaint for equipment and products to treat her father, even though the state health department says the hospital has the medicines and equipment needed to treat patients.”

The patient, a local politician, later died.

The Union of Health Department Employees suggested that — as many have said before — officials have glossed over shortages at hospitals.

“For some time we have complained about shortage of medications, ” the union said in a statement calling for the doctor's release. “It is not surprising that in many facilities relatives are asked to buy the bare essentials needed to treat patients, due to the negligence and inaction of the authorities.”

President Andrés Manuel López Obrador has had a troubled history with medical supplies. Suspicious of private firms, over-pricing and corruption, López Obrador's administration has been accused by parents of childhood cancer victims of delaying purchases of needed medicines.

López Obrador has overseen a pandemic policy that includes very little testing, but promised that “nobody will lack a hospital bed,” a pledge that has largely been fulfilled through rapid, often temporary expansion of existing facilities. But López Obrador appeared to acknowledge Thursday that the medications needed for those hospitalized may not have not always been available.

“I don't want the shortages of medicines to continue,” López Obrador said, while cautioning, “This has given rise to manipulation and disinformation."

“This all has one part that is real, and another that is linked to political manipulation and vested interests,” the president said.

In the past, corruption in awarding contracts, approving new medications and purchasing drugs has resulted in excess prices, scarcity, wasted or substandard medicine.

López Obrador said he will appoint the current head of the country's civil defense office to run the new agency, which will be advised by the U.N. and the World Health Organization. Mexico has already said it will join other countries in a joint effort to get access to any coronavirus vaccine, once one is developed.

Private pharmacies, importers and distributors of medicine will still be allowed to operate, as willl states that want to continue operating their own purchasing schemes.

Since taking office, López Obrador's near fanatical austerity, combined with his distrust of private companies and non-governmental groups, has led him to prefer centralized governmental solutions. It has also led him to clash with victims' groups, intellectuals, activists and business organizations.

“Everything was privatized, everything was contracted out,” López Obrador complained. “The government was left as a mere facade.”

Mexico has reported 408,499 confirmed coronavirus cases, though officials acknowledge that is a vast under-count because only about 950,000 tests have been performed in a country of nearly 130 million inhabitants. Mexico has 45,361 confirmed deaths, and appears headed to overtake the United Kingdom this week as the nation with the third-highest death toll in the world, behind the United State and Brazil.