In sub-Saharan Africa, the human immunodeficiency virus (HIV) is an epidemic that shows no signs of relenting. In 2013, an estimated 24.7 million people in the region were living with HIV, accounting for 71% of the global total. Worldwide, 2.1 million people became newly infected with HIV in 2015, according to UNAIDS.

While the disease cannot be cured, it can be prevented from spreading through a strategy called pre-exposure prophylaxis (PrEP), where people who are at a very high risk for HIV can take HIV medicines daily to lower the chances of becoming infected.

“PrEP can stop HIV from taking hold and spreading throughout your body,” according to the Centers for Disease Control and Prevention. “It is highly effective for preventing HIV if used as prescribed, but it is much less effective when not taken consistently.” A daily dose of PrEP can reduce the risk of contracting HIV from sex by more than 90%. Getting patients to take the drug daily, a problem with most chronic diseases, is critical for preventing HIV effectively.

Hoping to address this issue, the Bill & Melinda Gates Foundation is investing $140 million to help Intarcia Therapeutics, a Boston-based biopharmaceutical company, develop a tiny implantable drug pump.

The pump will use Intarcia’s Medici Drug Delivery System, which delivers HIV preventive medicine to healthy patients, ensuring they are consistent in the treatment. The matchstick-size mini-pump is embedded just under the dermal layer of the patients’ skin by a trained physician in an in-office procedure. The pump can hold six- or 12-month supplies of the drug.

The Gates Foundation’s investment is divided into two parts; $50 million for an equity stake in the company and $90 million in grants, pegged to Intarcia achieving certain milestones in developing the device. In the future, additional grants will be made to ensure broader access to the treatment, Intarcia said in a statement.

“There’s a vital need for an HIV/AIDS intervention that allows those at risk to incorporate prevention more easily into their daily lives,” said Sue Desmond-Hellmann, CEO of the Bill & Melinda Gates Foundation. The money is part of $1.5 billion fund created by the Gates Foundation to invest in technologies developed in the private sector that advance the foundation’s mission.

Intarcia is also developing a version of the pump, called the ITCA 650, to treat type 2 diabetes, and filed an application with the US Food and Drug Administration to market the device in November.

The company and the foundation have yet to decide which HIV preventive drug to use in the pump. And it will take several years before the device reaches the market. While it will be sold in the United States and other developed nations, the agreement between the foundation and the company is to ensure access to the pump in the developing world, and particularly sub-Saharan Africa where the HIV epidemic is most severe.