(CNN) Sen. Elizabeth Warren unveiled a plan Friday to ban private prisons and detention facilities, should she be elected president in 2020.

The Massachusetts Democrat wrote in a post on Medium that, as president, she would end all contracts the Federal Bureau of Prisons and US Immigration and Customs Enforcements has with private detention providers.

"We need significant reform in both criminal justice and in immigration, to end mass incarceration and all of the unnecessary, cruel, and punitive forms of immigration detention that have taken root in the Trump Administration," Warren wrote.

The US government has a "a basic responsibility to keep the people in its care safe -- not to use their punishment as an opportunity for profit," she said.

The senator would prohibit contractors from charging incarcerated and detained individuals "for basic services they need, like phone calls, bank transfers, and healthcare."

Read More